Return to Snippet

Revision: 38332
at December 31, 2010 03:54 by heislekw


Initial Code
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

On Error GoTo ErrHandler
   Select Case KeyCode
       Case vbKeyDown
           DoCmd.GoToRecord Record:=acNext
           KeyCode = 0
       Case vbKeyUp
           DoCmd.GoToRecord Record:=acPrevious
           KeyCode = 0
       Case Else
           ' Do nothing
   End Select

Egress:
Exit Sub

ErrHandler:
   If Err.Number = 2105 Then
       KeyCode = 0
       DoCmd.Beep
   Else
       MsgBox Err.Description
   End If
   Resume Egress
End Sub

Initial URL

                                

Initial Description
KeyPreview property must be set to Yes

Initial Title
Use arrow key to move through records in a continuous form

Initial Tags
form

Initial Language
Visual Basic