views:

299

answers:

2

Hi Everyone,

I have a few queries which need to be exported into a report and I want this to be done automatically each time the database is opened. I'm guessing this would be possible using VBA to which i dont have much knowledge off.

Can anyone help with this please?

Thank You

A: 

The easiest way would be to build a report based on the queries and add an Autoexec macro to the database to print the report.

EDIT Choose Create Macro, select Open Report as the Action, select the report name from the dropdown list, save the macro as AutoExec.

Remou
I have done some research on Autoexec macro's would you be able to give me an example and how to set it up. Thanks :)
Khalid
The highlighted link in my post includes detail of setting up such a macro, however, I have also added a note.
Remou
A: 

Maybe I'm missing something in your question but it sounds like you just need to base the report's record source on the SQL and don't need VBA. Copy and paste the SQL directly into the report record source. Every time you open the report it will automatically pull the most recent data.

That doesn't look right