print warning (not preview)

G

Guest

All-

I have a database with two almost identical reports. One for customers and
another for internal use. What is happening is that people are accidentally
printing and sending the internal copy to customers. I would like the
database to warn before the internal copy is printed. I thought the "on
print" event would do it, but that fires on the print preview as well. Is
there an event that fires only when the user actually prints the report?
Thanks.

Adam Milligan
 
G

Guest

Hi Adam,

If the two reports are nearly identical, then doesn't it make sense to
combine these into one report? You should be able to open a form in dialog
mode, when the report is first opened, that has the user select Internal or
External. Then, using relatively simply VBA code, you would display or hide
various controls appropriately. This way, you only have one report to
maintain.
Is there an event that fires only when the user actually prints the report?

Not that I know of.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
F

fredg

All-

I have a database with two almost identical reports. One for customers and
another for internal use. What is happening is that people are accidentally
printing and sending the internal copy to customers. I would like the
database to warn before the internal copy is printed. I thought the "on
print" event would do it, but that fires on the print preview as well. Is
there an event that fires only when the user actually prints the report?
Thanks.

Adam Milligan

No there is no event that fires only if the report is printed, but
there is an event that fires only if the report is previewed.
So, you can display a message when the report is not previewed
(printed), or make the detail section, for example, not visible when
printed.

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 "You are about to print a report that you shouldn't."
End If
intPreview = intPreview + 1
End Sub

You can also alter the report when/if actually printed:
In the Detail Print event..
If intPreview >= 0 Then ' or >= 1 if [Pages] used.
Cancel = true ' Hide the Detail section if printed.
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top