one report - many queries

  • Thread starter Thread starter shank
  • Start date Start date
S

shank

How can I create one report that is suitable for many queries? Is this
possible? How is this done?

I really don't want to make a report and save it to 20 different names, then
allocate a query to each. Especially if I have a small change I want to
implement to them. I'd rather edit one, than 20.

thanks!
 
Do you understand that you can dynamically apply criteria to queries? One
query, one report, lots of different recordsets reported...
 
Yes I'm aware. I was hoping to create an interface of just buttons so the
end users would not have to enter criteria. Click a button and the
appropriate report opens. Alternatively, there'd be too many conditions
they'd have to consider when they run the report. Just trying to make it
easy I guess.
thanks
 
So are you thinking that 20 different buttons is easier than selecting a
criteria from a list box, option group, combo box,.. and then clicking a
button? I guess it could be. You could create multiple buttons each with
code like:
'code for one button
DoCmd.OpenReport "rptYourReport", acPreview, , "[SalesDate] Betwee
#1/1/2002# and 3/31/2002#"
'code for another button
DoCmd.OpenReport "rptYourReport", acPreview, , "[SalesDate] Betwee
#4/1/2002# and 6/30/2002#"
'code for another button
DoCmd.OpenReport "rptYourReport", acPreview, , "[SalesDate] Betwee
#7/1/2002# and 8/31/2002#"
etc.

I would probably write one function to open the report and call it with the
where clause
Function OpenMyReport(pstrWhere As String)
DoCmd.OpenReport "rptYourReport", acPreview, , pstrWhere
End If
 
Back
Top