Results 1 to 8 of 8
  1. #1
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150

    Disable right click and paste for form controls

    Hello,



    I'm trying to ensure that people can't paste into a form on my database as it has stringent text validation rules that pasting circumvents. I have managed to disable ctrl V but people an still paste using right click and paste. How can I stop this? I found an article with instructions on creating a custom shortcut menu but it was for Access 2003 and I'm using 2010 so it doesn't work. Any help would be appreciated.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,538
    You could UNtick the "Allow Default Shortcut Menus"but this would also make make the right click menu unavailable for reports as well.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    You can disable the right click menu individually for forms:

    Click image for larger version. 

Name:	paste.png 
Views:	21 
Size:	9.3 KB 
ID:	41987

  4. #4
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    Quote Originally Posted by Bob Fitz View Post
    You could UNtick the "Allow Default Shortcut Menus"but this would also make make the right click menu unavailable for reports as well.
    That would probably work. They shouldn't need to right click at all (if I've done my job right). Where do I find this setting?

  5. #5
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    Thanks davegri, that's perfect and very simple, didn't know you could do that

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Just out of curiosity...what kind of text validation would be circumvented by pasting?

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    When I said "extensive" I may have been exaggerating to make it sound more impressive as it is. It's simply code that prevents certain characters being entered /"\& etc. The form takes inputs and uses them to automatically create directories on the drive so the text can't contain special characters that would make the dir command fail, the most common being the \. If you copy paste, the on_keypress code isn't executed so you can enter anything you want

  8. #8
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,538
    Quote Originally Posted by Robyn_P View Post
    When I said "extensive" I may have been exaggerating to make it sound more impressive as it is. It's simply code that prevents certain characters being entered /"\& etc. The form takes inputs and uses them to automatically create directories on the drive so the text can't contain special characters that would make the dir command fail, the most common being the \. If you copy paste, the on_keypress code isn't executed so you can enter anything you want
    You could put your validation code in the control's BeforeUpdate event or the Form's BeforeUpdate event, then you could allow use of the right click menu.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-14-2017, 06:46 AM
  2. Replies: 1
    Last Post: 03-21-2016, 10:40 AM
  3. Replies: 3
    Last Post: 03-19-2015, 02:11 PM
  4. Copy and Paste in right click menu
    By chriscardwell06 in forum Access
    Replies: 1
    Last Post: 12-27-2013, 09:15 AM
  5. disable controls on a subform,
    By jaymin in forum Database Design
    Replies: 2
    Last Post: 06-23-2012, 07:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums