select Query for report with two option groups

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Back
Top