Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 626
- Office Version
- 365
- 2010
- Platform
- Windows
I'm still new to Access, so I don't fully understand it. So I am taking an online class on Access and in the instructor's video, he has the following code:
However, when I run this code, I get the following error:
Run-time error '': The command or action 'RecordsGoToNext' isn't available now.
What does that me as far as Access is concerned. I'm not sure if the version of access matters with this code. Any help would be greatly appreciated.
VBA Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'MsgBox ("The keycode is " & KeyCode)
'Displays the keycode for the key pressed in a messagebox
Select Case KeyCode
Case vbKeyEnd
'Turns off the keys
KeyCode = 0
'Moves cursor to last line of the record
DoCmd.RunCommand acCmdRecordsGoToLast
Case vbKeyHome
'Turns off the keys
KeyCode = 0
'Moves cursor to first line of the record
DoCmd.RunCommand acCmdRecordsGoToFirst
Case vbKeyUp
'Turns off the keys
KeyCode = 0
'Moves cursor to previous line of the record
DoCmd.RunCommand acCmdRecordsGoToPrevious
Case vbKeyDown
'Turns off the keys
KeyCode = 0
'Moves cursor to next line of the record
DoCmd.RunCommand acCmdRecordsGoToNext
End Select
Run-time error '': The command or action 'RecordsGoToNext' isn't available now.
What does that me as far as Access is concerned. I'm not sure if the version of access matters with this code. Any help would be greatly appreciated.