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

  • Thread starter Thread starter mthornblad
  • Start date Start date
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
 
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.
 
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
 
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
 
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.
 
Back
Top