copy and paste

  • Thread starter Thread starter Guest
  • Start date Start date
In the form's Properties, set KeyPreview to Yes. Then in the KeyDown event,
try the following code:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If (Shift And acCtrlMask) > 0 Then
If KeyCode = Asc("C") Or KeyCode = Asc("V") Then
KeyCode = 0
End If
End If
End Sub

This cancels the keyed entry. It won't prevent the user from using Copy and
Paste from the Edit menu.
 
Back
Top