By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,960 Members | 2,238 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,960 IT Pros & Developers. It's quick & easy.

Use Code To Insert Code In Multiple Reports

P: n/a

I want to insert a procedure call to the report close event of 50 or so
reports in a database. As each report is opened and then closed by a user, I
want to log the date this occurrred. I am trying to gauge the usage
frequency of each report ( to see if certain reports can be removed all
together).

Is there a way to have a subroutine that, upon execution, loops though all
the reports in the database and adds some code to each one? I can figure out
how to loop through the containers("Reports").documents to find each report,
just don't know how to add code to each report object.


Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
It won't be really easy, but with 50 reports, it might be worthwhile.

You could start by looking at the entry for InsertText in the Access Help
file.
The procedure will be much easier if your reports already have modules.

HTH
- Turtle

"Mike Wiseley" <mi**********@gte.net> wrote in message
news:_j*****************@nwrddc03.gnilink.net...

I want to insert a procedure call to the report close event of 50 or so
reports in a database. As each report is opened and then closed by a user, I want to log the date this occurrred. I am trying to gauge the usage
frequency of each report ( to see if certain reports can be removed all
together).

Is there a way to have a subroutine that, upon execution, loops though all
the reports in the database and adds some code to each one? I can figure out how to loop through the containers("Reports").documents to find each report, just don't know how to add code to each report object.


Nov 12 '05 #2

P: n/a
Mike,

You don't have to do both open and close. If a report is opened, it will be
closed somehow. So usage frequency can be determined from open only.

One thing you could do ---

Put this code in a standard module:

Function MyFunction()
<Code to log name of the report and date report opened>
End Function

Then open each report in design view, open properties, go to the Event tab and
put this expression on the OnOpen line:

= MyFunction()

All your reports then will run that same function when they open recording the
name of the report and the date it was opened.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
www.pcdatasheet.com

"Mike Wiseley" <mi**********@gte.net> wrote in message
news:_j*****************@nwrddc03.gnilink.net...

I want to insert a procedure call to the report close event of 50 or so
reports in a database. As each report is opened and then closed by a user, I
want to log the date this occurrred. I am trying to gauge the usage
frequency of each report ( to see if certain reports can be removed all
together).

Is there a way to have a subroutine that, upon execution, loops though all
the reports in the database and adds some code to each one? I can figure out
how to loop through the containers("Reports").documents to find each report,
just don't know how to add code to each report object.


Nov 12 '05 #3

P: n/a
"Mike Wiseley" <mi**********@gte.net> wrote in
news:_j*****************@nwrddc03.gnilink.net:
I want to insert a procedure call to the report close event of 50 or
so reports in a database. As each report is opened and then closed by
a user, I want to log the date this occurrred. I am trying to gauge
the usage frequency of each report ( to see if certain reports can be
removed all together).


Far better to log such information to a table than to modify the report.
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.