Prevent report from printing - 10-17-2011 , 11:27 AM
I have a form with a button on it that basically previews an invoice (Report)
based on the form. If I try to print the report I get an error message which
almost certainly is wrong. It says “A custom macro in this report has failed
to run” I believe this actaully is the equally missnamed error "Too many
databases open" which means too many tables or queries open as I understand
The Code is DoCmd.OpenReport "RptPaymentRecord", acViewPreview, ,
"MemHeadOfHouseID = " & MemHeadOfHouseID
Anyway, I'm rambling.
I have a second button that Closes the Preview report and then runs
DoCmd.OpenReport "RptPaymentRecord", acViewNormal, ,"MemHeadOfHouseID = " &
MemHeadOfHouseID This runs OK
What I want to do is stop anyone using any of the print methods from the
Preview report such as ^P or right clicking the report.
Re: Prevent report from printing - 10-18-2011 , 09:55 AM
On Oct 17, 11:27*am, "Phil" <p... (AT) stantonfamily (DOT) co.uk> wrote:
a custom menu be of any use?
Re: Prevent report from printing - 10-19-2011 , 03:43 AM
On 18/10/2011 15:55:17, Patrick Finucane wrote:
Private Sub Report_KeyDown(KeyCode As Integer, Shift As Integer)
Dim intCtrlDown As Integer
' Use bit masks to determine which key was pressed.
intCtrlDown = (Shift And acCtrlMask) > 0
' Display message telling user which key was pressed.
If intCtrlDown Then
MsgBox "Sorry, you can't print from this preview, " & vbCrLf _
& "use the print button on the Payment record form.", vbInformation
Works a treat, brilliant