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

User DIY queries

Status
Not open for further replies.

maverickmonster

Programmer
May 25, 2004
194
GB
Hi

I have a system where users tick or enter information to filter data on. I currently set all to * at the moment but this will be explained later why.

When they have made thier choices they click the run query button . Every critira in the query is set to "Like([forms]![report]![status])" so if the member doesnt select anything then the query should use it like a wild card . but this isnt working . . . The user queries can be stored in a table.

Is this a poor way of doing what i want or is there a better way to do this ??

Thanks in advance

Maverickmonster
 
I prefer allowing the user to select items from a multi-select list box, combo boxes, and by entering date ranges.

Check out this FAQ faq181-5497 It contains a function (BuildWhere) that will build the where clauses for you. It works for most types of controls. You only have to do 3 things to make it work.

1. Create a new module and copy and paste the functions in the FAQ into the new module.
2. Set the Tag property of each of your controls as specified in the FAQ.
3. Open your report as specified in the FAQ (i.e. DoCmd.OpenReport "YourReport",,,BuildWhere(Me)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top