How do I set the focus for a field after new (blank) record ?

M

mthornblad

Hi

When I click the "new (blank) record" icon at the bottom of a form,
the cursor disappears. How can I make the cursor go to the first
field on the form like it does when I first go to the form.

Thanks in advance
Mark Thornblad
 
K

Ken Snell \(MVP\)

Use the form's Current event to run a macro that contains the GoToControl
action, and use that to set the focus to the desired field.
 
A

Allen Browne

Use the Current event procedure of the form to SetFocus to the field you
want, if it is at a new record.

Example:

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

mthornblad

Use the form's Current event to run a macro that contains the GoToControl
action, and use that to set the focus to the desired field.

Thanks so much Ken
I really appreciate your help. Just what I needed.
I have another question about a form/subform which I will make a new
post.

Thank again
Mark
 
M

mthornblad

Use the Current event procedure of the form to SetFocus to the field you
want, if it is at a new record.

Example:

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

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


When I click the "new (blank) record" icon at the bottom of a form,
the cursor disappears. How can I make the cursor go to the first
field on the form like it does when I first go to the form.
Thanks in advance
Mark Thornblad

Thank you also Allen.
 

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