• control keyboard behavior (Access 97 (SR2))

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » control keyboard behavior (Access 97 (SR2))

    • This topic has 5 replies, 4 voices, and was last updated 22 years ago.
    Author
    Topic
    #387187

    On 99% of the people who use a handy-dandy application I’ve set up, when they hit the Enter key on an input form, the cursor goes to the next field on the form. However, on this one person’s machine, instead of going to the next field, it goes to a new record. It’s not possible to get this user to change their Tools/Options/Keyboard, so is there a way to set the keyboard option to move to the next field and not the next record when this form is opened? It’s driving everyone crazy.

    Viewing 1 reply thread
    Author
    Replies
    • #674808

      It seems strange to adapt an application that works fine for just one recalcitrant user…

      You can do the following:
      Open the data entry form in design view.
      Set the KeyPreview property to True to handle keyboard events at the form level.
      Create a KeyDown event procedure for the form:

      Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
      If KeyCode = vbKeyReturn Then KeyCode = vbKeyTab
      End Sub

      This transforms an Enter into a Tab. You will have to test whether this has undesired side effects.

      When the user presses Enter or Tab in the last control in the tab order, the form will still go to the next record, unless you set the Cycle property of the form to Current Record.

      • #674825

        Yes, this is strange, but to make a long story short, the user’s a bit odd. I’ve heard that they are impossible to train and so to try to tell them there’s something “wrong” with their p.c. would cause them to, well, flee

        I’ll try out your suggestion, Hans, and let you know how it goes.

    • #674827

      [indent]


      It’s not possible to get this user to change their Tools/Options/Keyboard


      [/indent]

      Check out the GetOption, SetOption Methods in Help.
      I’ve never used them but it could provide you with a way to programatically save everyone’s sanity within your App.

      • #674835

        Add to what SteveH has suggested, if your application front-end is deployed to individual workstations, then if you activate security you could check the userID and set the Option for that user only.

      • #674836

        I wish. But sadly, no.

        What I did was use Han’s idea, plus (after I found I could go to a new record by hitting the Enter key past the last field on the form), I set the Cycle on the form to be “Current Record”. So now when someone nods off with their finger on the Enter button, they won’t end up creating 59 or so useless forms.

        thankyou Hans, Steve and Wendell!

    Viewing 1 reply thread
    Reply To: control keyboard behavior (Access 97 (SR2))

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: