If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How do I use a list box to open a report based on a single record
I've created a form (as a menu) and on this form there is a button. When I
press this button it opens a list box. The list box is based on a query which has selected customer id, first and last names from my database. I also have a report which will provide me with specific details about each customer. I want to scroll down the list and click on the selected customer, and automatically open the report showing that customer's details. I suspect I need to create some macro or criteria in the query, but don't know how to do this. Can anyone help me? |
#2
|
|||
|
|||
is the report bound to the query? and is CustomerID the primary key of the
table? if yes to both, there are two ways to get what you're after: make sure that the CustomerID is the bound column of the listbox. Solution 1 open the query in design view. in the CustomerID column, add the criteria [Forms]![MyForm]![MyListbox] substitute the correct names of form and listbox, of course. save and close the query. in form design view, create a macro attached to the command button, with an OpenReport action that opens the report. Solution 2 in the form's design view, create a macro attached to the command button, with an OpenReport action and setting the Where Condition, as [CustomerID] = [Forms]![MyForm]![MyListbox] substitute the correct field name, form name, and listbox name, of course. hth "Annie1904" wrote in message ... I've created a form (as a menu) and on this form there is a button. When I press this button it opens a list box. The list box is based on a query which has selected customer id, first and last names from my database. I also have a report which will provide me with specific details about each customer. I want to scroll down the list and click on the selected customer, and automatically open the report showing that customer's details. I suspect I need to create some macro or criteria in the query, but don't know how to do this. Can anyone help me? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Total hours from Table into Report | HeatherLou1974 | General Discussion | 3 | March 7th, 2005 08:04 PM |
Union Query Not Returning A Value | Jeff G | Running & Setting Up Queries | 2 | October 19th, 2004 05:47 PM |
Open associated report based on selection in combo box | Jonathan Brown | Using Forms | 2 | September 12th, 2004 04:23 PM |
Display Parameter from Form on Report | sara | Setting Up & Running Reports | 10 | July 19th, 2004 04:54 PM |