Hello All,
I've tried searching, but had no luck. Is it possible to create a generic report that could be used with multiple queries? And if so, please point me in the right direction.
Thanks in advance,
Bob
What happens if you get scared half to death twice?
if you put the following code in the OnOpen event for your form, you will be able to specify what query you want to run.
Me.RecordSource = "SELECT * FROM TableName"
You could also use a switch statement or if/else statement to have more than one query. Then you could use a combo box on your form to give the user a choice of which report to generate.
But this can get complicated if you are not selecting the same fields each time. Because they need to be linked to the report to be displayed in textboxes. Hopefully this will help you out.
Is the objective to use queries based on the same data but having different criteria to filter?
If so, you might want to consider using parameter queries to get the criteria from the user or, better still, use a query by form where the user enters or selects the criteria desired and those values are passed to the query.
With either method, you need only one query but change the criteria 'on the fly'.
HTH
Larry De Laruelle
ldelaruelle@familychildrenscenter.org
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.