Form Open - go to new record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have been playing with the OnOpen command for a data entry form. i would
like to have the data entry form go to a new record once the form is open.

thanks,
 
Add this line to the Open event:

DoCmd.GoToRecord , , acNewRec
 
David,

If you set the form's Data Entry property to Yes on its property sheet, then
this happens automatically, but will not allow you to view/ edit other
records.

Or if you want to intermittently open the form in Data Entry mode, you'd use
the 5th argument in the DoCmd statement on the calling form.

DoCmd.OpenForm "MyForm", , , , acFormAdd

Or if you want to immediately go to a new record but be able to view/ edit
existing records, you can either code it in the calling form:

DoCmd.OpenForm "MyForm"
DoCmd.GoToRecord , , acNewRec

OR

You can use the 'called' form's On Open or On Load event

DoCmd.GoToRecord , , acNewRec

HTH,
Brian
 

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

Back
Top