On Sat, 26 Feb 2005 15:05:07 GMT, Wolfgang wrote:
Hi,
I need to timestamp printed records with the printing date. According
to the customer's requests the report must be opened in preview-mode
and the user clicks on the printer button if he really want to have a
hardcopy.
The customer selects the records with a special selection form, where
he can combine up to appr. 20 different criterias, which are combined
to a more or less complex filter string. This string is then written
to the filter property of a form (where he can modify the records), to
the filter property of a report (which will be displayed in preview
mode) and to do the timestamp I copy the filter as WHERE part to a SQL
string which makes the update in the table. This works great, but I
could not find out how to get the information if the report has really
been printed.
Has anybody a good idea?
Oh yes, I use MS-Access XP
Thx Wolfgang
While the below code will let you know when the report has been sent
to the printer, directly or after preview, there is no way to
guarantee that it has actually been successfully printed until you
have the paper report in your hand.
The actual starting value of intPreview depends upon if you have a
control in the report to compute [pages].
Option Compare Database
Option Explicit
Dim intPreview As Integer
Private Sub Report_Activate()
intPreview = -1 ' If [Pages] is not used
' intPreview = -2 ' If [Pages] used
End Sub
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
If intPreview >= 0 Then ' If [Pages] not used
' If intPreview >= 1 Then ' If [Pages] used
MsgBox "Gone Printing"
End If
intPreview = intPreview + 1
End Sub
You can use it to do something only if the report is actually sent to
the printer, i.e. in the Report Footer Print event....
If intPreview = 0 Then
' do something here
End If
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.