/ Published in: Visual Basic

KeyPreview property must be set to Yes
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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
Comments
