Using the Down Arrow

C

CD Tom

I would like to use the UP and Down arrow to jump from
one field to another in a form. When you setup a Event
for Key down any key pressed caused the field to move.
How do you identify the key you want to use.
Thanks for your help.
 
R

Rick Brandt

CD Tom said:
I would like to use the UP and Down arrow to jump from
one field to another in a form. When you setup a Event
for Key down any key pressed caused the field to move.
How do you identify the key you want to use.
Thanks for your help.


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

On Error GoTo ErrHandler
Select Case KeyCode
Case vbKeyDown
***Your code goes here***
KeyCode = 0
Case vbKeyUp
***Your code goes here***
KeyCode = 0
Case Else
' Do nothing at all!
End Select

End Sub
 
J

Jack

You would automatically get what you want by just setting
the Tools/Options/Keyboard settings to:
Arrow Key Behavior = Next Field
Behavior Entering Field = Select Entire Field
However, if you are in an Option Button Group or Memo
Field, you would still have to use the Enter or Tab key to
leave the group or field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top