View Full Version : Sql query report -- maybe a stupid question


mlh407
10-25-2005, 10:04 AM
I am not sure if this should be in reports or under vba.

I would like to take a sql query, (Select * from table_name where a=1). It might return 5-10 rows.

I would like to have a script, that opens up a report, filters by a query, prints the report, closes the report, and takes you back where you started from without any user intervention.

Can this be done, are there code examples?

Pat Hartman
10-25-2005, 07:56 PM
Use the query as the RecordSource for the report rather than a table. You probably need some user intervention such as a button click to trigger the code to run. In fact, once you've built the report, add a button to a form and the button wizard will guide you through the process.