create a report using vba to select the names for the report

I need to create a report of selected Customers, I have gone as far as
creating a string with customer names in it. Whats next?

sample = 

Selected_Customer_Names= [ABC], [test], [New], [A New One] ...... and so on.

Is this correct for the report and/or how do i open the report with the above
only listed?

Message posted via

4/28/2010 3:47:34 AM
access.modulesdaovba 1670 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 47

On Wed, 28 Apr 2010 03:47:34 GMT, "trevorC via" <u44860@uwe>

>I need to create a report of selected Customers, I have gone as far as
>creating a string with customer names in it. Whats next?
>sample = 
>Selected_Customer_Names= [ABC], [test], [New], [A New One] ...... and so on.
>Is this correct for the report and/or how do i open the report with the above
>only listed?

square brackets delimit field or control names. This list won't do what you
want. If you have customers ABC, Test, New and so on; and these names are
unique (names rarely are, I know three guys named Fred Brown), then you could
use a string with the names in doublquotes:

 "ABC", "test", "New", "A New One"

and use this string in the WhereCondition argument of the OpenReport action:

DoCmd.OpenReport "MyReport", WhereCondition := "[CustomerName] IN (" _ 
  & Selected_Customer_Names & ")"

But I suspect there are better ways to go about it if you would care to post
some information about your table structures and the context in which you're
doing this.

             John W. Vinson [MVP]
4/28/2010 4:11:52 AM

Similar Artilces:

create a roster
How can you create a weekly roster in which functions can be assigned to more than 10 people. The roster should be updatable, so that when holidays and days off are marked on the weekly roster they will be taken account of it future rosters. ...

Display filename, path in report footers
I am trying to get the filename, path etc appear in report footers. Can anyone tell me how this could be done. Thanks in advance. SJ SJ wrote: >I am trying to get the filename, path etc appear in report footers. >Can anyone tell me how this could be done. Thanks in advance. SJ The path and file name of the front end mdb file can be displayed in a text box by using the expression: =CurrentDb.Name -- Marsh MVP [MS Access] ...

importing or creating reference footnotes
I am trying to import a word document into publisher and it has reference footnotes within the document. The reference footnotes are not coming into the publisher document with the reference footnotes. Correct, they will not up to Publisher 2003. In Publisher 2003 depending on which version of Word you are using if they will or not. -- "If you don't know where you are going, any road will take you there!" ...

Mailbox not created when AD account created
A couple of days ago I noticed that I created a user account but the 'Email Addresses' tab of the user properies did not list any email addresses. Subsequent new user accounts have all experienced the same. I researched the knowledge and tried the recommended solutions to either manaully start the recipient update service or rebuild te recipient update service. Neither recommendation has resulted in a mailbox being created for this particular user or any additional user that I have created since this error first showed up. I performed a Windows update last Thursday and so I bel...

VBA Question
Hi, I have a form with a combobox control that list some sizes. They are: 12 18 20 22 I have another text box for keying a custom size, such as 12'2". What I would like to do is have the combobox default to the next size (in this case 18). Here's the code I have used so far (it does a little more than what I am asking for but to give an idea): Dim MCUST As String MCUST = Me.custwidth If Str(Me.widthck) <> Me.custwidth Or Len(Me.custwidth) <> Len(Me.widthck) Then Me.widthck.Value = Int(Val(MCUST)) + 1 If InStr(Int(Me.widthck) / 2, ".&...

using CList as a base class in an extension DLL
Hi all. I must be doing something wrong but cannot figure it out. I have a data class and a list class, in an extension DLL, declared like this: >#define DllExport __declspec (dllexport) >class DllExport CRate : public CObject { >public: > DECLARE_SERIAL (CRate) > CRate () { m_Rate = 0; } > CRate (const CRate &in) { *this = in; } > > const CRate& operator= (const CRate& in) > { m_Rate = in.m_Rate; m_Date = in.m_Date; return *this; } > > bool operator== (const CRate& in); > bool operator!= (const CRate& i...

Task Create - Status
I'm trying to make a simple task, when a user owner is assigned a task in CRM, it receives an email letting it know it has one. I have the following below, but it is not generating one when i assign one manually in the CRM. What to do? I've tried both the following: When task is created E-Mail to:[owner];Subject test As well as: When task is created if Task activity status = Open then E-Mail to:[owner];Subject test I've checked the mailserver many times over, and I can send emails manually from the CRM so you can rule that out Tested out ok on our end. Some ideas:...

chart on the report
I wanted to have a chart on my report base on my table or query. Are there any controls support this? Your help is great asppreciated, Click on the Query. choose Insert, Report. Choose Chart Wizard. If you want the report to be linked to a field in your report (eg a different sales chart for each employee) then you can make the chart a subreport, putting in the correct section of your report eg the Details section and in the Properties box of the subreport choose the Master and Child fields (the Unique field that the chart and the main report have in common - usually a primary key field) ...

Help Creating XmlNode / XmlAttribute Elegantly
I am creating a configuration class to read / write a standard configuration file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="ConnectionString" value="server=(local);" /> </appSettings> </configuration> I am using a XmlDocument for my base implementation. I am looking to see if there is a better way to add a new node / attribute than using XmlDocument.InnerXml. I would consider this to be a hack but couldn't really see another way of doing this without definin...

Bug with cell merging in tables using Applescript
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Once you have merged cells in a table in Word 2008 using Applescript, any further reference to the table's cells in the script produce an error. <br><br>As an example, open Word 2008 and run this script: <br> tell application &quot;Microsoft Word&quot; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make new table at active document with properties {number of rows:4, number of columns:4} <br> &nbsp;&nbsp;&nbsp;&nbsp...

Using the highlighter
In the old Office programs you could highlight something in yellow (like you would with paper & highlighter). I'm using Excel 2003 and I can't find that option any where. Does Office still have this feature and where or how can I find it. I want to print a name & address list with some names highlighted. Please help! That was/is in Word, not Excel, AFAIK "Joan" <> wrote in message > In the old Office programs you could highlight something in yellow (like > you ...

Create external database
Hi all. I need to create an external database (file). On a site I found this code: ------------------------------------------------------ Function CreateLinkedExternalTable(strTargetDB As String, strProviderString As String, strSourceTbl As String, strLinkTblName As String) As String 'strTargetDB = Source Database Name 'strProviderString = Not used, currently hard coded 'strSourceTbl = Source Table name in the database we are linking too. 'strLinkTblName = Table name we would like to see in the Access Database. Dim catDB As ADOX.Catalog Dim tblLink As...

Open Report
Using MS Access 2003. I have a filter form that opens a report based on the criteria selected. The user can select 4 different reports. 3 work fine. The other one requires the user to press the process report button twice. On the second press, the report opens fine. I debugged for errors upon opening the report and the degger returns a 0 for err.number after the report is opened. Ideas? Thanks. ...

How to create pie chart with %
I have got a problem that I don't if excel could help me to calculate the % within a column and draw a pie chart. My case is I have a column containing a series of numbers. e.g. 1,4,8,1,3,9,11,2,4,5,6,.........etc I want to draw a pie chart that showing 1-3 , 4-6, 7-9, >9 with the corresponding % inside that column. Can anyone tell me how can I make it ? Ray - You need to calculate the frequencies in your data. Let's assume your data is in A1:A12. In B1:B3 enter these numbers, the upper limits on the groupings: 3 6 9 You can enter ">9" into B4 witho...

excel with another reporting tool?
hi, I have only worked on vba macros where my input and output is both excel. Using macros most of the time it crashes and the end-user is then not comfortable with it. I wanted to go for a better solution. Not sure how go to about it. I was thinking of generating crystal reports. If i use crystal reports how is the format generated. I wanted to its feasibility study. Anyone who has done some work on this please go suggest. Will the end user have the authority to still edit the report. WIll it contain the formulas as we fianlly see in the excel. Please provide any infomartion that...

Email address not created when a new user is created
All, This issue recently happened in my company. Upon creating a new user, the policy was set to create the smtp and X400 address automaticaly. Now when we create a user the smtp and x400 addresses are not created, and when attempting to setup the new user in outlook, the address cant be found. We are using exchange 2003 SP1 on Win2k3 servers. On Wed, 13 Jul 2005 06:49:07 -0700, "Bryan" <> wrote: >All, >This issue recently happened in my company. Upon creating a new user, the >policy was set to create the smtp and X400 addres...

when form created
I have a form which was created by someone else (not a form template) which is like a questionnaire with empty boxes to be completed. When the boxes are typed in all the margins move to accommodate the words being typed. Is there a way to fix/lock the original form and then just fill in the blank boxes? I suspect this is set up as a table with auto resizing enabled. Displaying table gridlines (Table | Show Gridlines) will help you see what you're dealing with. Then select the table, go to the Table tab of Table Properties, click Options, and clear the check box for "A...

Exchange 2010 MRM, no log files being created
I'm hoping someone can help me with this has been driving me crazy for days. I have enabled MRM logging on our exchange server, and I can see that some of the policies are working when I run start-managedfolderassistant. We have a retention policy tag on the deleteditems folder, and this does work. The problem is I am not getting any files in the MRM log directory. C:\Program Files\Microsoft\Exchange Server\V14\Logging\Managed Folder Assistant Events 9021 and 9022 are logged in the Application log, but where are the files? Below is the output of my mai...

defragging exchange2003 server using diskeeper 10
Im thinking of using diskeeper 10 to defrag our exchange server computer which is on 2003 server SP1. Is this a safe program to use ? Is it best to shutdown the exchange services first before doing and online defrag to allow the software to "defrag" the exchange stores. ? or just use diskkeepers boot time defrag option ? thanks for any responses First few lines should answer your question about disk defrags on Exchange servers. For production deployments, I would make sure the vendor (Diskeeper) explicitly states compatibility - a quick search on their web site did not ret...

Item Movement Report Amendement...
Dear all, Some time ago there was an amendment made to the Item Movement Report provided by Akber (thank you Akber it's great). What I'm interested in is seeing an item's qty sold / on hand (which I already have) and the total committed. If possible, if I could then see what was then available (as in what is on my shelves) that would be great. We find that if we have received 48 items, sell 31 - then look on the shelf and only find 10, we of course are short for that item. Of course, once one does a report on an item by item basis and clicks on the Inventory tab you get...

Select items from list and show in text box
I want to be able to select an items from a list I have setup and have them show in a text box (possibly with the aid of a select button). Could someone please explain to me how to do this as I have no idea about Visual Basic and macros don't work? Thanks in advance Jeanette You can create a dropdown list with data validation: Or, create a combobox on a UserForm: wrote: > I want to be able to select an items from a list I have setup and have > them show in a ...

Creating a Brochure
How do you create a 3-column brochure from scratch for Publisher 2002? I can only find the directions for the 2003 version. Quick help would be appreciated, project is due Monday. Create a three-panel or four-panel folded publication Scroll down to the section that says "Build a three-panel or four-panel publications from scratch." -- Mary Sauer MSFT MVP news:// "Derek" <> wrote in message news...

inconsistent restriction/sort expression error in report writer
When I'm generating the Multicurrency Long Form report, the error "Inconsistent restriction/sort expression. Please add the following restriction 'calc20008 = calc20008' appears. I tried doing the knowledge base article 864430 but still the error appears. This report have modifier with vba in it. It did not specify which fields I need to add in the restriction. Hope someone can help me. Thanks, If you did follow KB article 864430 and you are still getting this error, it means you still have not identified the most nested table in your report (the one with the more d...

OWA and Domain\User Name Logon
Something strange happened to the logon requirements when logging onto OWA... Initially when I configured OWA the user was required to use his or her domain with their username when logging onto OWA. Now, the domain portion before the user name is no longer required. Although more convenient for the user to logon this way, I'd like to see the logon requirements as they were with the domain portion of the logon required. I am wondering what could have happened to change this feature. Any ideas? How would one change it back? Thanks in advance. Raymond- If somebody put a \ in the default...

How to create Access macro shortcut
I'm still using Access 97 and saw something the other day that I would like to use that was in Access 2000. In an Access 2000 database, there was a .mam file in a directory that launched the Access 2000 program and ran a macro. How do you set this up? Can it be done in Access 97? If so, how? Hi. > How do you set this up? Select the macro in the Database Window and right click with your mouse, then select "Create Shortcut..." in the pop-up menu. Follow the prompts for where to place the shortcut and what to name it. The default is: <PathToDeskTopDir>\Shortcut ...