Mendip Data Systems

Database applications for businesses and schools

LogoTransparent

 

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

 

   Dim intCtrlDown As Integer

   intCtrlDown = (Shift And acCtrlMask) > 0

   

   If KeyCode = vbKeyV Then

     If intCtrlDown Then

       MsgBox "You Pressed Ctl + V"

       KeyCode = 0

     End If

   End If

 

   If KeyCode = vbKeyC Then

     If intCtrlDown Then

       MsgBox "You Pressed Ctl + C"

       KeyCode = 0

     End If

   End If

 

End Sub

Code Samples for Businesses, Schools & Personal Use

Updated 29/10/2017            

 

If you want to prevent users copying and pasting text into an Access form:

 

1. Set the form’s Key Preview property to YES

2. Put this code in the form's KeyDown event

 

Code:

Prevent Copy & Paste on Forms

Return to Code Samples Page