开发者

Generate Reports from Ms Access 2007 Using Queries automatically via VBA

开发者 https://www.devze.com 2022-12-19 20:01 出处:网络
I have a few queries which need to be exported into a开发者_JAVA技巧 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

I have a few queries which need to be exported into a开发者_JAVA技巧 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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消