OnEnter, go to the same field in the next record of a continuous f

G

Guest

I have a form designed for data entry. It has to be a continuous form for
many reasons.

My user wants to be able to fill up the data of all the first field, then
the second, etc...

Is there a way in the code, probably in the OnEnter procedure of the field,
to make the cursor move to the same field of the next record ?

Thanks for your help !
 
M

missinglinq via AccessMonster.com

There's two ways to do this.

1) Goto Tools > Options > Keyboard and Uunder "Move After Enter" select
"Next Record"

or

2) For each control (what you call field) you want to exhibit this behaviour
use this code:

Private Sub YourControlName _KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
DoCmd.GoToRecord , , acNext
End If
End Sub

The first method will make this behavior the default for all controls (fields)
on ALL FORMS! This may or may not be problematic for you.

The second method will only affect the controls (Fields) that you use the
code for, but you will need to repeat the code for each control.

BTW, in Access *fields* are found in tables, while *controls* are found on
forms, and hold the values of fields!

Good Luck!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 

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