Continous Form using Key down


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
 
Ad

Advertisements

R

Rob Parker

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
 

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