Arrow Keys

libby32

Registered User.
Local time
Today, 07:45
Joined
Mar 6, 2003
Messages
42
Hi, in addition to the tab key, how can I let the user use the left and right arrow keys to advance to the next field on a form and where would I put the code??
 
Hi

Never really thought about this so i tried it on one of my forms and the arrow keys seemed to work fine.

Sorry can't be any more help

Chris
 
I wonder why it does not work on my subform??
 
I sue this in continuous subforms.

All the arrow keys will navigate the form like a spreadsheet....

Function ArrowKeysNavigate(intKeyCode As Integer)

'****** Arrow key navigation procedure for continous subforms *******

'Allows Up and down arrow keys to navigate through records, spreadsheet style

'Call from form's KeyDown event....
'ArrowKeysNavigate KeyCode

'NOTE Key preview (Event) on form MUST be set to Yes, No is set by default.

On Error GoTo Form_KeyDown_Err
Select Case intKeyCode
Case vbKeyDown
DoCmd.GoToRecord Record:=acNext
intKeyCode = 0
Case vbKeyUp
DoCmd.GoToRecord Record:=acPrevious
intKeyCode = 0
Case Else
' Do nothing at all!
End Select

Form_KeyDown_Exit:
Exit Function

Form_KeyDown_Err:
Select Case Err.Number
Case adhcErrInvalidRow
intKeyCode = 0
Case Else
MsgBox "Error: " & Err.Description & _
" (" & Err.Number & ")"
End Select
Resume Form_KeyDown_Exit
End Function
 
Just a thought.

Have you checked your program options?

Tools / Options / Keyboard (Arrow Key Behaviour)

?

Brad
 

Users who are viewing this thread

Back
Top Bottom