Results 1 to 5 of 5
  1. #1
    jlgray0127 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    185

    When press tab, ignore keypress event

    In forms, I have an event set at the keypress event, that opens a subform for the user to type into another form, if they are trying to enter data. (I have one record, that could over a period of time, need many notes added to it. I capture all this data in another table to keep all the notes separate for this one record)


    If the user is using the tab key, and does not want to type a comment, I'd like for Tab to not trigger the keypress event.
    I can not find a good sample of code that works.

    Simply put, I want any key but tab to trigger the keypress event. Can someone help me create a code that basically ignores the keypress event if tab is the key that is pressed?

    Thank you!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Why not just change it to a null (0) in the KeyPress event.

  3. #3
    jlgray0127 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    185
    I'm not sure what you mean there? I've not done much with the keypress event, other than using it to trigger an action... never with any criteria.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Okay, I'll give you some links that should help. We should probably use the KeyDown event instead of KeyPress.
    https://msdn.microsoft.com/en-us/lib.../ff194937.aspx
    http://stackoverflow.com/questions/2...unction-in-vba
    https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Did you figure it out yet? I'm willing to assist further if you would like.

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

Similar Threads

  1. KeyPress event please help
    By braveheart_bh in forum Forms
    Replies: 1
    Last Post: 08-25-2015, 12:00 AM
  2. What's happening with "on key press" event?
    By BaldFox in forum Access
    Replies: 2
    Last Post: 06-17-2013, 08:23 PM
  3. A KeyPress Event and UNICODE character set
    By Marin in forum Programming
    Replies: 0
    Last Post: 02-27-2013, 08:32 PM
  4. Replies: 1
    Last Post: 03-31-2011, 02:51 AM
  5. How to Programmatically Press a Key
    By Osman in forum Access
    Replies: 5
    Last Post: 11-28-2010, 11:07 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