Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2002
    Location
    Washington State
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Trapping Keystrokes (A2k)

    I imagine this is a simple question: How do I trap the keystroke Shift-Tab on a field

    To trap a Tab press I can just use
    If KeyCode = vbTab Then
    in the KeyDown event

    But I'm not sure how to detect if a Shift key is pressed...

    Thanks!
    Sam

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Trapping Keystrokes (A2k)

    You should use 9 instead of vbTab, for KeyCode is an integer and vbTab is a string representing the Tab character.
    The On Key Down event procedure has a second argument Shift that can be used to inspect the state of the modifier keys Ctrl, Shift and Alt:

    If (KeyCode = 9) And (Shift And acShiftMask) > 0 Then

  3. #3
    Star Lounger
    Join Date
    Jan 2002
    Location
    Washington State
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Trapping Keystrokes (A2k)

    Awesome! Perfect! Thanks Hans!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •