How to set the default field on a form

R

Rob Drummond, Jr

I am creating a data entry form. I would like to have the cursor
automatically appear in the first field on the form when the "New Record"
button is clicked. How do a set a field as the default or tell the
form/database where to put the cursor when a new record is being created?
 
F

fredg

I am creating a data entry form. I would like to have the cursor
automatically appear in the first field on the form when the "New Record"
button is clicked. How do a set a field as the default or tell the
form/database where to put the cursor when a new record is being created?


1 Code the Form's Current event:
Me.[TheControlName].SetFocus

This will set focus to that control each time you navigate to another
record.

2) If you ONLY wish to do this for a new record entry, then code the
Current event:
If Me.NewRecord Then
Me.TheControlName.SetFocus
End If
 

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