Catch the Paste event?

I work for my own cabinet manufacturer, and we are writing our own pricing program for our product. I have a form that has a popup, so the user can choose which side the hinge will be turned on for the ambiguous doors on this cabinet. I have this to work so far, but when they copy the element and paste it at the bottom, I don’t want the popup to appear. Is there a way in Access VBA to find out if a new record is inserted or manually entered?

+3
source share
2 answers

You can customize the menu, for example, if you added this code to the standard module:

Public gvarPasted As Boolean

Function AssignVar()
    gvarPasted = True
    DoCmd.RunCommand acCmdPaste
End Function

Action Paste , . ( ), . , . .

+1

, - .

Option Compare Database
Public gvarPasted As Boolean

Private Sub txtText_AfterUpdate()
If Not gvarPasted Then
    'Open pop-up here
Else
    gvarPasted = False
End If
End Sub

Private Sub txtText_KeyDown(KeyCode As Integer, Shift As Integer)
'Detect ctrl-V combination
If Shift = acCtrlMask And KeyCode = vbKeyV Then
    gvarPasted = True
End If
End Sub
+3

Source: https://habr.com/ru/post/1698480/


All Articles