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] 7

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:

Appending Excel data into an Access table while inserting the file name
I have a loop in an Access 2003 database that appends records from multiple Excel files within a given directory. The name of each Excel file cycles through one variable (ImpFileName) as its records are imported, but I also need to add the Excel file name to each record. I wanted to assign the value of ImpFileName to the DefaultValue property of the FileName field in the table as part of the DoWhile loop, but something is wrong with my syntax. My code is below, but only works if I comment out the line that assigns the DefaultValue property. Any help would be much appreciated! Dim tdf...

Treeview format for a report
I want to create a multi-tiered report that's formatted like a treeview. I have items that belong to classes, and the classes can belong to other classes. I need the report to list the class and any subclasses and items that are a part of that class, i.e.: Class 1 Items... SubClass1.1 Items... SubClass1.2 Items... SubClass1.2.1 Items... Class 2 Items... SubClass21 Items... SubClass2.2 Items... SubClass2.2.1 Items... etc. The number of parent and/or child nodes can vary. There's no way to know how m...

Microsoft Error Report on OneNote 2010 Beta: Detail Included
Microsoft Office 2010 Beta OneNote One original notebook and several of the included templates Original notebook is password protected. On startup of OneNote 2010, the first page of the original notebook appears, along with the grey screen where you are supposed to click to enter your password. Before I get a chance to click to enter the password, the following message appears: Microsoft OneNote has encountered a problem and needs to close. We are sorry for the inconvenience. The information you were working on might be lost. Microsoft OneNote can try to recover it f...

Use this correction update
--lakymbtkhmtihejq Content-Type: multipart/related; boundary="qkvrwqngjewmscak"; type="multipart/alternative" --qkvrwqngjewmscak Content-Type: multipart/alternative; boundary="jhmbjtnsxte" --jhmbjtnsxte Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft User this is the latest version of security update, the "September 2003, Cumulative Patch" update which eliminates all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express. Install now to maintain the security of your computer fr...

using hyperlink to open image file from a button
I use the hyperlink function to open an image file on the hard disk whose address is contained in a cell. But can I get this to attach to a button using a macro or can I open a file whose address is contained in a cell in some other way. I used a button from the Forms toolbar and placed it on my worksheet. I assigned it this macro: Option Explicit Sub testme() Dim BTN As Button Dim testStr As String Dim myCell As Range With ActiveSheet Set BTN = .Buttons(Application.Caller) Set myCell = ActiveCell Set myCell = .Cells(BTN.TopLeftCell.Row, "A&...

Report printing on two pages versus one page
We are on GP 9.0. I have several users that have to swap between 2 printers frequently. When they use the Ricoh printer (a GP non-supported printer), the Job Status/Closing Report prints on 1 page to that printer. However, when they use the HP LaserJet 4300 (a GP compatible printer with the correct GP compatible drivers), the exact same report (same job number/same report) prints on 2 pages. I've tested it on myself and have noticed that even when I display the report the screen (not even printing it), it has this problem. If I have the Ricoh selected under File - Print Setup, t...

Using the Euro symbol
I have an Access front end to a SQL Server 2005 database using ODBC linked tables. There appears to be a problem when using the euro symbol in queries. SELECT * FROM tbl_Datatable WHERE (tbl_Datatable.strPRICE)='?40'; This query returns nothing although there are many entries with a strPRICE of '?40' SELECT * FROM tbl_Datatable WHERE (tbl_Datatable.strPRICE)='$40'; This query returns all with a strPRICE of '$40' How do I use the symbol in queries? Regards Colin Col wrote: > I have an Access front end to a SQL Server 2005 database using ODBC lin...

using UDL to connect to Foxpro database
Hi all, It seems that microsoft is no longer supporting ODBC connection to Visual Foxpro 9. Instead, it is recommended to use OLE database provider. I have created the connection information to be used with the OLE driver (UDL file) but I can't find how to use it from within the pivot table "get data" wizard. I can only see the ODBC connections. Can anybody help? Thanks ...

can't fwd to internet email using Rules Wizard
Hi, I'm sorry if this has been brought up before. I'm not able to forward my incoming emails to any internet email using Outlook 2000 SR-1. There's no blocking AFAIK. If I forwarded the email manually (click Forward, type in the internet email), the recipient can receive the emails. However, if I automate it using Rules Wizard, the recipient doesn't receive my email. There's no error message returned to me, btw. I'm the Exchange Admin here, so where do I start t/shooting? THANKS. ,Sur Sur <> wrote: > I'm the Exchange Admin here, so...

Identify same names #2
Than you... it worked ok.... Rodolf -- rodolfor ----------------------------------------------------------------------- rodolform's Profile: View this thread: ...

Dynamic data selection for charts
Hi, I want to create a chart with dynamic data from a drop down. Like if i select option 1 in the data validation drop down the chart should populate with data from sheet 1. and if i select 2 then it should populate with sheet 2 data. Please suggest a way to do the same thanks sudheera Hi, You need to set up dynamic named ranges. And here is some information on charting from selected data Cheers Andy -- Andy Pope, Microsoft MVP - Excel "sudheera&q...

COUNTIF? Use one column as condition to determine average of another
This may be beyond the scope of basic excel, but here goes. C4:C16 contains a list of times, or durations in this case. In D4:D16 each cell contains either a "yes" or "no" what I would like to do is average the "yes" times. So referenc D4:D16 as a condition to determine which times to average. I could just manually seperate the "yes" times and compute the average but there must be a way to do it as described above -- Message posted from On 5/8/04 6:43 PM, in article, "pacman2k4...

Changing a text name within a cell based on file name
Hello, I wonder if it is possible to change a cell contents based on the file name. For example I am using Excel file 2003 in my workbook sheet 1 in cell A2 it is populated with a text field - company name "Zenith Manufacturer" and in cell A3 has the company location text field "Tampa Florida" I have about 50 reports. The file name on one report can be Sch88 (Zen) or Ex 1 (Zen), etc. All of the 50 reports have unique names, but has the same identifier within the parentheses (Zen). Here is my problem I have to duplicate the same 50 reports with a different compan...

3.0: Worflow Manager: Emails are not being sent when using a temp
I have created a rile that will email to the Contacts email address when a CST create a new Case record, the Case Stage is Logged using an Email Template. I understand that when using templates the To field is disabled so I have selected Logical User/Contact for the CC field. My test has been to create a new case and wait for the email to be delivered which it isn't. Then from Cases, I manually Apply Rule and receive: An error has occurred. Please contact your system administrator. Can anyone help me with this? Many thanks on advance. ...

Remove 'Non Commercial Use' in Office title bar
QUESTION: - How to easily & quickly remove the 'non commercial use' in the title bar for a newly installed version of office professional 2007? BACKGROUND I am running Windows 7 and have the Office Professional 2007 on dvd. My new laptop was pre-installed with office 2007. I did not un-install this, I just put in my new office 2007 professional dvd and completed the installation. Everything works, however, outlook (only outlook) displays the 'non-commercial use' in the title bar. I have no entry for office 2007 in the add/remove programs. The only entry i...

Cannot get access to Reports/System Settings in CRM 3
Hey When i click on Reports, i get this error: Error An error has occurred. For more information, contact your system administrator. when i run http://servername/reportserver it is OK. But when i try to access http://servername/reports then The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. -------------------------------------------------------------------------------- A name was started with an invalid character. Error processing resource 'http://servername/reports/'....

Run report without running access?
Hi - Dumb question: To keep it simple, can I create a link or shortcut for a report so that with a click of the mouse the report will show? GWB wrote: > Hi - Dumb question: > To keep it simple, can I create a link or shortcut for a report so that > with a click of the mouse the report will show? You can have it open Access, then your file, then your report. But Access and your file have to be opened. ...

Select invoices for payment across multiple AP Vendors
Be able to select invoices for payment across a group of vendors in Great Plains AP, but print seperate checks for each vendor once the invoices are selected. This will streamline the process of selecting invoices when a vendor has multiple payment departements, but you need to view all open invoices. We are currently on GP8. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open t...

Use general email with SBS2003
This is a multi-part message in MIME format. ------=_NextPart_000_0014_01CAD69B.DA75D230 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi guys, I have the following case. The customer have a general email address = which he wants all workstations to have access from Outlook within a = SBS2003 server. Is there a way to setup this general email address ex: = so user A,B,C can receive this email and been able to = reply using this email address only? Thanks! P.S. If I would not be using Exchange ...

creating mailboxes E2K7?
HEllo, as you see i'm new to E2K7 and i *wrongly* thought it would be an easy upgrade path like e2k to 2k3, well i can't find anything!, i've spent most of last week reading documentation, techcenter, blogs, sites to no avail. mainly, �WHERE IS MY ADU&C INTEGRATION?, i was very fond of the exchange tasks and be able to view mailbox properties on the same console, now the ADUC doesn't has anything about exchange, and on exchange MMC there's that wizard which is useless if i want to create letsay.. more than 3 mailboxes. what happens if i want to create a mailbox at...

How to change font style for highlighting using ITextDocument
Hello, Using the Rich Edit Control I am able to change the font style at will for text ranges but this causes the document to be flagged as modified which is not what I want, how can I modify the font but not effect the modified flat? Eli >Using the Rich Edit Control I am able to change the font style at will for >text ranges but this causes the document to be flagged as modified which is >not what I want, how can I modify the font but not effect the modified flat? Eli, Have you considered calling CRichEditCtrl::SetModify to clear the control's modified flag? Dave -- MVP VC...

using Money 98 files under Windows 7 Home Premium?
Hello, I have a friend who I have just moved onto Windows 7 Home Premium. He has some Money 98 , .mny, files. I understand that Microsoft has stopped support for Money? How can he access these files? He still has Money 98 on his old PC - can he open the files with this and save them in another form which he could access under Windows 7? Cheers Geoff In, Geoff wrote: > > >I have a friend who I have just moved onto Windows 7 Home Premium. > >He has some Money 98 , .mny, files. I understand that Microsoft has >stopped support ...

Failed to logon using AUTH.
I currently have an EX2k SP3 server running on a W2k DC/GC SP4 server. I recently installed EX2K3 on a W2K3 Enterprise member server, which will become our new Exchange server, into our single forest domain. I created four test users with mailboxes on the W2K/EX2k server, upon completion of this; I performed a mailbox move, of one of the test users, on the EX2K3 server successfully. The move process was fairly quick and after a refresh within Enterprise Manager the Mailboxes were shown in the “Administrative Group/First Storage Group/Mailboxes" container within the EX2K3 Server. I verifie...

In Excel, using line wrap with text, some cells will appear as ##.
In Excel, using line wrap for text, some cells will appear as ######### on one line. Attempts to correct the problem by re-entering the format (text-line wrap checked-top alignment) do not work. Even copying the style from a "good" wrapped cell does not correct the problem. If it has to do with column width, double-click on the line between the column with the ### and the one to right, you 'll expand the column, exposing the full number. EX: cell A1 has ####, so position the cursor between the A and the B column headers, on the line until the cursor turns into a black lin...

Great Plains should use Transaction Processing in SQL Server
This concerns Great Plains version 7.5 on MS SQL Server 2000 SP3. Day before yesterday a brief electric power outage occurred exactly while a user was posting a batch of invoices in PM. The database server and other network components were on UPS and did not fail in any way, but the workstation PC doing the posting was not on a UPS and it rebooted. This left the invoice batch in a sort of "half posted" state. In fact there was resulting damage in both the PM and GL areas of the database, because we have the system set up to post through in detail to GL. We first attempted...