How do I set query parameters from forms? (1 Viewer)

neilxt

New member
Joined
Jun 18, 2012
Messages
3
Every time I look for ways to set a parameter from a form everything I see says to instead set the query itself to directly access the form field.

I do NOT want to have to do this. :banghead:

I have multiple reports running off the same query and launched from different forms. I want to be able to determine the key field for the query from the form and then launch the required report. As it stands, I have generated 3 nearly identical queries which I now have to keep in step and where the ONLY difference is the source name for matching the key field to one or other form field.

Thanks guys.
 

pbaldy

Wino Moderator
Staff member
Joined
Aug 30, 2003
Messages
33,654
A couple of options: you can copy the value to a hidden textbox on a form that will always be open and point the query there. I use a form just to gather parameters, and open it from the various other forms, and the report from there. This sounds like it might be the easiest though:

http://www.baldyweb.com/wherecondition.htm

after taking the criteria out of the query.
 

neilxt

New member
Joined
Jun 18, 2012
Messages
3
Thanks, I came up with a similar cludge, working the other way round, crated a query with all the data and three crosstab queries linking that to a small query which just selected the one record selected by the one form. I still consider it a cludge solution though. Are we really saying that it can't be done just to set the parameter then run the query?

Doesn't it just seem that Microsoft does everything backwards?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom