Re: Creating a log file (archive) of reports printed
From: Nikos Yannacopoulos (nyannacoREMOVETHISBIT_at_in.gr)
Date: 05/18/04
- Next message: Ken: "Sort Subform"
- Previous message: anonymous_at_discussions.microsoft.com: "Procedure declaration does not match description of event or procedure"
- In reply to: Nasos: "Creating a log file (archive) of reports printed"
- Next in thread: Nasos: "Re: Creating a log file (archive) of reports printed"
- Reply: Nasos: "Re: Creating a log file (archive) of reports printed"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 18 May 2004 14:39:40 +0300
Naso,
Create a table to hold details on the print events, with fields for report
name, date/time, detail1...X etc (I would also add a field for the user).
Then use a few lines of code at the beginning of your print procedure to
store that info in the table by means of a DAO recordset. Sample code:
Dim rst As DAO.Recordset
Set rst = CurrentDB.OpenRecordset("TableName")
rst.AddNew
rst.Fields("ReportSelected") = varReportName '(variable must be assigned a
value first)
rst.Fields("TimeStamp") = Now()
rst.Fields("Detail1") = Forms!FormName!txtDetail1
...
...
rst.Fields("Detail1") = Forms!FormName!txtDetail1
rst.Fields("User") = CurrentUser 'if you have implemented security, or
rst.Fields("User") = Environ("UserName") 'to log the Windows logon name
rst.Update
rst.Close
Set rst = Nothing
Of course, you will need to change my example table, field, form and control
names to the actual ones. You will also need to add the DAO library to the
db references, if not already there (Microsoft DAO 3.51 for Access97,
Microsoft DAO 3.6 for Access2K or later).
HTH,
Nikos
"Nasos" <anonymous@discussions.microsoft.com> wrote in message
news:2D4EDFA3-4FBB-46A4-BECC-3B0788DA7BDE@microsoft.com...
> I have a form where the user selects which report they want to print and a
few other details e.g. they can change the title and a few other fields in
the header and footer areas. My problem is how can I open a log file and
append a record each time with the actual details as they were printed (with
which title etc) I have tried OpenTable but it open the table for manual
data entry, I dont want the user to see the log table at all. I will the
create a report which can print the log file but not change any of the
entries. Thanks
- Next message: Ken: "Sort Subform"
- Previous message: anonymous_at_discussions.microsoft.com: "Procedure declaration does not match description of event or procedure"
- In reply to: Nasos: "Creating a log file (archive) of reports printed"
- Next in thread: Nasos: "Re: Creating a log file (archive) of reports printed"
- Reply: Nasos: "Re: Creating a log file (archive) of reports printed"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|