A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I use a list box to open a report based on a single record



 
 
Thread Tools Display Modes
  #1  
Old April 6th, 2005, 07:05 PM
Annie1904
external usenet poster
 
Posts: n/a
Default 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  
Old April 6th, 2005, 07:36 PM
tina
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 06:28 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.