select Query for report with two option groups

S

Steve Wood

Hi
Is it possible to select the query for a report based on the results of two
option groups on a form?
eg the report requires the same set of information, but the query it uses
will depend on option group "A" select cityA, CityB, CityC, and option group
"B" ParkA, ParkB, ParkC. Therefore if option group "A" = CityA, and Option
group "B" = ParkB then use query "X" etc etc.
Thank you in advance
 
K

Keith Wilby

Steve Wood said:
Hi
Is it possible to select the query for a report based on the results of
two
option groups on a form?
eg the report requires the same set of information, but the query it uses
will depend on option group "A" select cityA, CityB, CityC, and option
group
"B" ParkA, ParkB, ParkC. Therefore if option group "A" = CityA, and Option
group "B" = ParkB then use query "X" etc etc.
Thank you in advance

Yes, build a query string based on the option group settings, then pass the
string to the report using OpenArgs in the DoCmd.OpenReport line of code.
In the report's open event, set the record source to Me.OpenArgs.

HTH - Keith.
www.keithwilby.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top