add same code to multiple reports for onclose event?

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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
 
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>
 
Back
Top