• Keyboard navigation in continuous form (Access 2K SP3)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Keyboard navigation in continuous form (Access 2K SP3)

    Author
    Topic
    #381693

    When my data was viewed in continuous form, the 4 arrow keys only move my pointer one field to the left or right within the same record. How do I make my UpArrow and DownArrow keys work as in datasheet view, i.e. to position the pointer one record up or a record down the current row?

    Thanks in anticipation.

    Viewing 2 reply threads
    Author
    Replies
    • #644530

      Have a look at the setting for record cycling (form properties) – it may be set to keep on same record.

      • #644535

        The Cycle properties of my form is set to the default – All records.

    • #644532

      Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
      On Error GoTo Form_KeyDown_Err
      Select Case KeyCode
      Case vbKeyDown
      DoCmd.GoToRecord Record:=acNext
      KeyCode = 0
      Case vbKeyUp
      DoCmd.GoToRecord Record:=acPrevious
      KeyCode = 0
      Case Else

      End Select

      Form_KeyDown_Exit:
      Exit Sub

      Form_KeyDown_Err:
      Select Case Err.Number
      Case adhcErrInvalidRow
      KeyCode = 0
      Case Else
      MsgBox “Error: ” & Err.Description & _
      ” (” & Err.Number & “)”
      End Select
      Resume Form_KeyDown_Exit
      End Sub

      • #644551

        Thanks, RichUK, your sub works as I expected.

        • #937429

          Gotta love the search engine here! Took about two minutes to find this solution after I realized what was causing the new and unxpected behaviour in my app after changing from a datasheet to a continuous subform.

      • #1022131

        FYI: a cross reference to an addition of Francois…

        In Move to next record with arrow key (2003 sp2)
        Francois pointed out that those getting a “variable not defined” error at the line “Case adhcErrInvalidRow”, can use “Case 2105” instead.

    • #937620

      I think all you need to do is use Ctrl-DnArrow and Ctrl-UpArrow. No code should be required.

      Revised later: Guess not. These two keys go to the first and last record on the subform…

      • #1026957

        Ctrl-PgDn (and of course, Ctrl-PgUp) at least in Access 2000

        Love the lounge search engine.
        I was looking for a way to navigate by keyboard, found this thread, saw your “guess not”, and my “Theory Of Life” training for mouse vs. keyboard kicked in, which says, in one way, “Try every combination of the eight basic navigation keys(*), then add Ctrl, Shift, and Shift-Ctrl“.

        Hence Ctrl-PgUp.

        (*) Left Arrow, Right Arrow, Up Arrow, Down Arrow, Home, End, PgUp, PgDn

    Viewing 2 reply threads
    Reply To: Keyboard navigation in continuous form (Access 2K SP3)

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

    Your information: