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

Query with multiple criteria in one field

Status
Not open for further replies.

fej008

Programmer
Apr 29, 2008
3
US
I am trying to build an inventory form that when opened will prompt the user for the Asset tag number(s) and then the rest of the form the user will fill in. The Asset tags comes from one field and there are thousands of them. But I only want them to see the requested assets. I don't know how to create a query (for the users it will be a dialog box) that will allow you to enter multiple criteria for one field.

How can I accomplish this?

fej008
 
By dialog box are you talking about an "InputBox" that will pop up and ask them for the "Tag Numbers"?

If so then I can see some problems with input errors.

I would probably create my own "Pop up" form with a textbox where the user enters the numbers one at a time and those entries would go into a listbox. Once the person is done making their entries, I would have a command button that would build the query from there and open the form. That way I could control and varify the input values as they are entered and then properly build the where clause for either the SQL query or a form filter.
 




"...create a query (for the users it will be a dialog box) that will allow you to enter multiple criteria for one field."

Use the IN operator, like...
Code:
Where YourField IN ('A','B','C')



Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thank you for responding but I think I need be a little more detailed. I want the users to enter as many Asset tags as they need and once they have entered them and press Enter then the Serial# and description fields will be populated for each Asset tag and they can finish filling in the rest of the form. Once they have completed filling in the form they will then generate one report with all the information for signature.
 
I would create a small table of AssetTags in the front end MDB file. This could be cleared of all records and allow users to enter new values. Add this small table to a query with the other table to filter to just those entered by your user.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top