Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    163

    Unanswered: keypress events (combo and textboxes)

    When I press the directional arrow keys in a form, they jump from one object to another. How do I set the up and down arrow keys to pull down and select choices from a combo box?

    Pressing the enter key once in a textbox will execute an afterupdate event once. If I press enter again, nothing happens, only when the textbox's contents are changed does the event trigger when the enter key is pressed. How do I set an event to be triggered every time the enter key is pressed?

    Thanks!

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    To change this, select Tools (top menu) -> Options, then select the Keyboard tab and you'll see "Arrow Key Behavior" as well as "Enter Key Behavior" (depending on which version of MSAccess you have.)

    You can also select the Enter key behavior in the properties box on the form for that control.

    "Pressing the enter key once in a textbox will execute an afterupdate event once. If I press enter again, nothing happens, only when the textbox's contents are changed does the event trigger when the enter key is pressed. How do I set an event to be triggered every time the enter key is pressed?"

    - again, you may need to issue a "Refresh" command in the AfterUpdate event for the control or even possibly look at the AfterUpdate event of the form (again, possibly issueing a Refresh command.) Also, maybe the OnDirty event of the form may be something to look at (although I rarely use the OnDirty event so I'm not sure on this.)
    Last edited by pkstormy; 09-02-08 at 23:14.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    When I press the directional arrow keys in a form, they jump from one object to another. How do I set the up and down arrow keys to pull down and select choices from a combo box?
    What on earth for?? Teach users that F4 opens a combo box... then arrow keys can be used to select what they want or if they just start typing, autocomplete will select the item they want without even opening the combo box.

    Pressing the enter key once in a textbox will execute an afterupdate event once. If I press enter again, nothing happens, only when the textbox's contents are changed does the event trigger when the enter key is pressed. How do I set an event to be triggered every time the enter key is pressed?
    Why would you want to do that! AfterUpdate SHOULD only run AFTER the contents are UPDATED!!!

    If you want to run some code every time ENTER is pressed, then you should trap it with the KeyPress event
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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