Trigger a macro when report is run

  • Thread starter Thread starter colin.steadman
  • Start date Start date
C

colin.steadman

Hi,

I've been asked to write a macro to change the image in a report using
a field that the report returns. I've worked out how to do that using
Image.Picture = LoadPicture (if it works the same way as Word).

What I've not worked out is how to trigger the macro when the report is
started. How do you get a macro to run when the report is started?

Thanks,

Colin
 
Hi Colin

You can run the macro using
acCmdRunMacro

This function can be triggered in many ways like - open the report, on click
of the print button, etc. Press F1 for more info on using the code builder
if you're not sure on the method.

Hope this helps
 
Arvin said:
A report has an Open event. In the report's design view, turn on the
report's property sheet and click on the event tab. Put the name of the
macro in the Open event.

Aha! Thats what I was looking for! I did however have to use the
'Activate' event as the 'Open' event didn't allow us to read the
location on the images from the report.

Cheers!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top