Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How To Control Up/Down Arrow Key? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    I

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How To Control Up/Down Arrow Key? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    John

    I might not be reading this correctly, but I have just created a continuous form in one of my test DB's and have managed to get the cursor to move backwards and forwards with my arrow keys, be it field by field.

    Are you saying that if you are in the third field of a record and you press the up arrow, it will automatically go to the third field in the record above, similar to if you were in Excel?

    Jerry
    Jerry

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

    Re: How To Control Up/Down Arrow Key? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Set the Key Preview property of the subform to Yes.
    Create an On Key Down event procedure as follows:

    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    On Error Resume Next
    Select Case KeyCode
    Case vbKeyUp
    RunCommand acCmdRecordsGoToPrevious
    KeyCode = 0
    Case vbKeyDown
    RunCommand acCmdRecordsGoToNext
    KeyCode = 0
    End Select
    End Sub

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How To Control Up/Down Arrow Key? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    Thank you Hans

    I assume if you want to restrict this to a field on the form I would use the KeyDown Event with same code?

    Thanks, John

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

    Re: How To Control Up/Down Arrow Key? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    If you want to do this for a single control, set the Key Preview property of the form to No, and put the code in the On Key Down event of the control, not of the form.

Posting Permissions

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