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

How can I find out if a report has been printed after pre-viewing

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.
Nov 13 '05 #2

P: n/a
On Sat, 26 Feb 2005 17:03:12 GMT, fredg <fg******@example.invalid>
wrote:
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


Thank you for the quick response and the sample code.
Wolfgang
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.