Move focus to specific field

L

Lars Brownie

When the user presses the built-in form button (little triangle with
asterisk) to make a new record, I would like the focus to move a specific
field, so that the user can start entering the form in the right field. How
can I accomplish this?
Thank you, Lars
 
A

Allen Browne

1. Use the Current event of the form.
2. Test its NewRecord property.
3. SetFocus to the desired field.

Example event procedure:

Private Sub Form_Current()
If Me.NewRecord Then
Me.[NameOfSomeControlHere].SetFocus
End If
End Sub
 
L

Lars Brownie

That did it! Thanks Allen.
Lars

Allen Browne said:
1. Use the Current event of the form.
2. Test its NewRecord property.
3. SetFocus to the desired field.

Example event procedure:

Private Sub Form_Current()
If Me.NewRecord Then
Me.[NameOfSomeControlHere].SetFocus
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Lars Brownie said:
When the user presses the built-in form button (little triangle with
asterisk) to make a new record, I would like the focus to move a specific
field, so that the user can start entering the form in the right field.
How can I accomplish this?
Thank you, Lars
 

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