Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create a "Generic" report

Status
Not open for further replies.

bdjb

Technical User
Oct 29, 2002
292
US
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.
 
Thanks Jason246Day,
I'll give the combobox solution a try.
Bob

What happens if you get scared half to death twice?
 
bdjb:

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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top