Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Function Keys for Own Purposes (A2K)

    This is probably not allowed but, I'm converting a friend's Q & A Dos database into A2K. He's comfortable with using function keys instead of a mouse. Is there a way that I could for instance, make the F10 key save his record?
    Cheers,
    Andy

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

    Re: Function Keys for Own Purposes (A2K)

    1. In general, the user doesn't need to do anything to save a record - this is done automatically when the user moves to another record or closes the form.
    2. There is a built-in shortcut key to save the current record: Shift+Enter.
    3. You can define shortcut keys that work throughout the whole database by creating a macro named AutoKeys.
    4. You can define shortcut keys for a specific form by setting the Key Preview property of the form to Yes, and write code in the On KeyDown or On KeyPress event of the form. KeyPress is mostely for "standard" keys, for function keys you need KeyDown (or KeyUp):

    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    On Error GoTo ErrHandler
    ' Test for F10
    If KeyCode = vbkeyF10 Then
    ' Save current record
    RunCommand acCmdSaveRecord
    ' Cancel standard action of key
    KeyCode = 0
    End If
    Exit Sub
    ErrHandler:
    MsgBox Err.Description, vbExclamation
    End Sub

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Function Keys for Own Purposes (A2K)

    Hans,

    As always, you come through with the ideal solution. I realize that these records are saved when they exit, but I also trigger a couple of other events and I mostly want him to feel warm and fuzzy with his new system. Function Keys are his security blanket. Thanks again,

    Andy
    Cheers,
    Andy

Posting Permissions

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