Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Reports

Status
Not open for further replies.

bujin

MIS
Oct 2, 2000
144
GB
Hi

In the latest update to my on-going database project, I wish to write a log-file when the user performs certain actions (e.g. importing trainee data, printing reports). Writing the log-file is easy enough, and the code is already in place.

What I want to do now is when the user runs a report and prints it out, a line is written to the log-file, something like:

"DD/MM/YY - Report printed (DD/MM/YY - DD/MM/YY)"

(the details aren't important).

There are two ways I can think of doing this. Firstly, I can create my own "Print" button which writes the line to the log-file, then prints out as normal, or secondly, by using the standard print function and having some code in the report to write the log when it is printed.

So, is there a way to show the print dialog box through VB code, or is there an event that allows me to perform a VB action when a report is printed. (I tried the ReportHeader onPrint method, but it didn't seem to work).

Thanks
 
Never mind, I found the answer. I created a function to write the log file and display the print dlg with

DoCmd.RunCommand acCmdPrint
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top