Results 1 to 4 of 4
  1. #1
    gangel is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    194

    Using Tab as keydown but not for Shift+Tab

    Hi ppl,.



    I have a keydown event which fires on keycode 13 (enter)

    1. I want it to also fire on TAB (keycode 9?) but NOT fire on Shift Tab.. i still want shift tab to go to previous control.

    2. If i use keydown for enter then i need to use textbox.text but if i use tab then the .text function doesnt seem to work! :/ where does this leave me? Putting if me.dirty then me.dirty=false on each keydown event and not using .text at all?

    thanks in advance

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    This may help

    As for Enter OR Tab, I would think you can use OR in your logic.

  3. #3
    gangel is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    194
    thanks i got the tab and shift tab issue under control but not the tab .text issue

  4. #4
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Does the Tab key still change the selection? The .Text property is only available if the Textbox currently has focus. If it doesn't have Focus, then you should use the .Value property instead (or just reference the Textbox directly).

    The .Text Property only stores data while a textbox is being actively edited. As soon as you change the focus, Whatever's in the .Text property gets saved to the .Value property and the .Text property is cleared.

    If it has Focus
    Code:
    strVariable = Me!txtMyTextBox.Text
    If it does NOT have Focus
    Code:
    strVariable = Me!txtMyTextBox 'Same as using Me!txtMyTextBox.Value

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

Similar Threads

  1. shift + f2
    By willifords in forum Access
    Replies: 1
    Last Post: 07-10-2014, 05:17 PM
  2. Alt + Shift + Tab -- No Icon!
    By LindaRuble in forum Programming
    Replies: 7
    Last Post: 03-18-2013, 03:15 PM
  3. Replies: 2
    Last Post: 04-21-2012, 11:17 PM
  4. Shift By Pass
    By pkstormy in forum Code Repository
    Replies: 4
    Last Post: 03-18-2012, 05:51 PM
  5. Keydown and SendKeys
    By Remster in forum Programming
    Replies: 10
    Last Post: 08-10-2011, 10:39 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