Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Define Query Criteria Parameter Value from a List Box

Status
Not open for further replies.

alexbel

Technical User
Jun 27, 2004
77
US
Hi,

I have a query with the following values in it:

Item ID
Item Text
Possible Answers
Correct Answer
Item Classification


Under Item Classification, I have the following criteria:

Code:
[Forms]![frmForm1]![Item Classification]

Here's what I want to do:

I have a list box on the form that lists all of the Item Classifications currently in the database. When the user clicks a certain Item Classification, I want a report (rptReport1) to open and display only the records that have the selected Item Classification.

So my question is....How can I have the list box automatically fill in the parameter value for the criteria with the user's selection?

Thank you
 
Hi alexbel,

I think what you need to do is to create a query that you will use to populate your report. In the query select all the fields that you wish to output in the report.

In the selection condition for the field ItemClassification set the value to be the name of the listbox control that you have selected

eg if your form with the list box is frmForm and the list box control name is lsbListBox then the selection condition would be

[Forms]![frmForm]![lsbListBox]



#
###
#####
#######
Ziggurat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top