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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can you use a combo box/list in a query? 1

Status
Not open for further replies.

wolfpackman

Technical User
Mar 26, 2001
3
US
I have Access '97 and I am trying to extract data from a master table using a query. In the criterion, how do you use a combo box or list, etc. to get choices from the master table. The application would be a type of catalog where all the information is stored in the master table. I am then trying to query this data but I would like to have choices in the query from each column and then have all my input give me the best matches and send this information to a report. Can you possibly use the lookup function when you right click in the criterion field of the query and if so what do you type? I have tried using a text box, combo box and list, etc. but with no luck. Any help would be greatly appreciated....

Thanks
 
You can use parameters with your query but these cannot be configured as comboboxes. Your best bet is to use an unbound form with comboboxes for your user to make their selections from then set the criteria of the query to the choices made in this form. There are a couple of ways to do this. One is to directly set the report's filter property when you open it(via a command button and the DoCmd.OpenReport "reportname",,,"criteria" command) or simply set the query's criteria for each field to the appropriate control of the unbound form:

Forms!UnboundFormName!ControlName

or

Like Forms!UnboundFormName!ControlName & "*"

The latter will return all records if no selection is made in the combobox control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top