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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query

Status
Not open for further replies.

richmond88

IS-IT--Management
Sep 25, 2003
32
GB
I have reports that can be run from a number of Forms and I dont know which is the best way to feed the data to the reports. The criteria can also change based up on which field the user wants to report on. Hopefully someone can give me some advice on the best way to do it.

Should I :-

1) Have a tempprint table and Insert the data into that table from the Form that executes the report -

sql = "INSERT INTO tblTest (VadarStudentID, SetID)" & _
"SELECT * From Query4 Where " & _
"SetID =120"

DoCmd.RunSQL (sql)

2) Have a hidden Variables Form or Global variables where I store the criteria and execute the query from the report.

I hope that this makes sense and that someone can give me the best and most efficient way of achieving my aim.

Thanks

Chris
 
I would advise against global variables, since they are far too easy to loose track of...

as for hidden forms, well, if you're happy creating a new form, and messing about with everything on that form, and passing info between the controls on the form, then that would probably be easiest, however I'd not recommend it if there's more than about 5 parameters to fill in...

most secure way would probably be with the tables, just remember to clear the tables you're using.

Have you considered just saving the various sets of parameters as different queries, and then upon activation of the report, just rebound the report to the relevant query. This will mean more saved queries, but should be faster than messing about with extra forms/tables...

--------------------
Procrastinate Now!
 
Thanks for the Reply Crowley.

At present I do what you say in the last paragraph but it is becoming a pain in the arse to keep track of all the Queries from various reports - so that is why I am looking for a bit more organised way.

Thanks

Chris

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top