Results 1 to 9 of 9
  1. #1
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Keyboard navigation in continuous form (Access 2K SP3)

    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.

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Keyboard navigation in continuous form (Access 2K SP3)

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

  3. #3
    Lounger
    Join Date
    Nov 2001
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Keyboard navigation in continuous form (Access 2K SP3)

    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

  4. #4
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Keyboard navigation in continuous form (Access 2K SP3)

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

  5. #5
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Keyboard navigation in continuous form (Access 2K SP3)

    Thanks, RichUK, your sub works as I expected.

  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    632
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Keyboard navigation in continuous form (Access 2K SP3)

    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.
    --------------------------------------------------
    Jack MacDonald
    Vancouver, Canada

  7. #7
    2 Star Lounger bobdog's Avatar
    Join Date
    Jan 2001
    Posts
    108
    Thanks
    3
    Thanked 5 Times in 4 Posts

    Re: Keyboard navigation in continuous form (Access 2K SP3)

    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...

  8. #8
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Leuven, Vlaanderen, Belgium
    Posts
    322
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Re: Keyboard navigation in continuous form (Access

    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.

  9. #9
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Keyboard navigation in continuous form (Access

    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

Posting Permissions

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