Suppress Keyboard shortcut for printing

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

I want to prevent people from being able to print a form by mistake by using
Ctl-P to print. I have already removed the print menu and any icons, but a
user was able to print the form by using ctl-P. Ideally, I would like to
intercept the ctl-P command and call the code that is associated with a
button I have on the form that is called "Print".
 
scott said:
I want to prevent people from being able to print a form by mistake by
using
Ctl-P to print. I have already removed the print menu and any icons, but
a
user was able to print the form by using ctl-P. Ideally, I would like to
intercept the ctl-P command and call the code that is associated with a
button I have on the form that is called "Print".

You can greate a macro group called AutoKeys in which you can re-map just
about any keypress you like.

Search the help file for 'AutoKeys'.
 
You could also use this little bit of code:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If (Shift And acCtrlMask) And (KeyCode = 80) Then

MsgBox "<Ctrl> + <P> Has Been Disabled! Please Use The Print Button!"

End If

End Sub

I've got a Messagebox popping up here, but you should be able to call the
sub behind your custom Print button from here as well.
 
Back
Top