add same code to multiple reports for onclose event?

G

Guest

I have the following code ( DoCmd.Restore) that I need to add to about 30
reports onclose event... can I do this in some type of batch mode?

any suggestions?

Brook
 
J

Jeff Boyce

Brook

While it is probably possible, are you more interested in learning about how
to code a "batch job", or more interested in having the code in the reports?

If the latter, open one report's code module. Insert your 'restore' code
line in the report's OnClose event. Copy it.

While still in VBA, open each of the other reports and insert the OnClose
event (header, end, and 'restore') in each.

Remember to recompile.
 
G

Guest

Well, i'm interested in both, having the code in all my reports, but not
having to copy paste it into each report.. how can it be done in batch mode.?

Thanks,

Brook
 
J

Jeff Boyce

Brook

I'll step aside, as I focus more on getting done, moving on. Perhaps one of
the other newsgroup readers can offer ideas/code. The general approach
would be to create a new procedure that iterates through the collection of
reports, adding the event code to each.

Good luck

Jeff Boyce
<Office/Access MVP>
 

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

Top