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!

Dynamic additions to query from a subform

Status
Not open for further replies.

tyemm

Technical User
Feb 28, 2005
66
US
I don't know if that subject line describes it best, but I have a subform, continuous form, that selects text strings for a query. Basically it is a multiple choice situation: pick any number from a list. I get this list using a select distinct query. A text box accumulates these text strings: firstchoice, secondchoice, etc.

Then on the main form, I'd like to click a button and run a query, the criteria for one of whose fields would be all the accumulated text strings. I tried just referencing my text box, storing these strings, but I now see that won't work, i.e. I can't have a query field referencing a text box and giving it "firstchoice" or "secondchoice" or, etc. This looks OK to me, but it doesn't work and probably means I need to generate a new WHERE clause for each choice made in the subform.

Can someone point me to a generic solution, i.e. a dynamic WHERE clause generator for a query?

Thanks,
Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top