Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event Handler for Mouse Right Click and Select

Status
Not open for further replies.

ShaimaaT

Programmer
Aug 18, 2014
16
EG
Hi all,

I want to handle the event when I right click and choose "Paste" to pop up a message to the user that he cannot paste; disabling the pasting functionality.

I understand that the Button parameter refers to right or left button , but I need further help on which event to best use (mouse up ,mouse down , mouse move - as it seems to be a mixture of the three) and the code for that event.



Private Sub List_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
' See if the right mouse button was clicked
If Button = acRightButton Then
'DoCmd.CancelEvent
'do event here
End If
End Sub


I don't want to cancel after there is a right click , but rather after right clicking and choosing "Paste".

Thank you

Best Regards,
Shaimaa
 
Controlling the clipboard, copying cells, and controlling pasting is not easily done in Access without going to the Windows API. What is the big picture of what you are doing and why doing it this way? There may be a much better interface to accomplish this. You may get this to work but in my experience your solution will require lots of workarounds and by "cludgy" in the end. Normally if people want to copy and paste records in a database, I think there is probably a problem with the overall database design. I build a lot of Access dbs and never need to resort to this type of interface.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top