Continous Form using Key down

  • Thread starter Thread starter CD Tom
  • Start date Start date
C

CD Tom

is there a way to us the key down event to move to next line on a continous
form. Right now I have four columns across the form, when the user presses
enter the cursor moves to the next column. That's fine except I would like
to be able to allow the user to press the down arrow and have the cursor move
down to the next record instead of across the row, is this possible? Thanks
for any help.
Tom
 
Hi Tom,

Place the following code into the KeyDown event of each of the textboxes in
your continuous form. It actually does a little more than you asked for -
down arrow moves to next record, up arrow moves to previous record, Home
moves to first record, End moves to Last record.

On Error Resume Next 'prevents error message if can't move to specified
record
Select Case KeyCode
Case 35 'End
DoCmd.GoToRecord , , acLast
Case 36 'Home
DoCmd.GoToRecord , , acFirst
Case 38 'Up arrow
DoCmd.GoToRecord , , acPrevious
Case 40 'Down arrow
DoCmd.GoToRecord , , acNext
Case Else
End Select

HTH,

Rob
 
Back
Top