on open do to new record

G

Guest

I am trying to add some code so that when a form is opened, it takes the user
straight to a new record. I can get it to go to a specified record using
this code:

Private Sub Form_Open(Cancel As Integer)

DoCmd.GoToRecord acDataForm, "Linking Factory to a Supplier form", acGoTo, 100
end sub

Can anyone help me, I've tried putting 'new' and changing acGoTo to acNew,
but they don't work.
 
K

Keith Wilby

Chris said:
I am trying to add some code so that when a form is opened, it takes the
user
straight to a new record. I can get it to go to a specified record using
this code:

Private Sub Form_Open(Cancel As Integer)

DoCmd.GoToRecord acDataForm, "Linking Factory to a Supplier form", acGoTo,
100
end sub

Can anyone help me, I've tried putting 'new' and changing acGoTo to acNew,
but they don't work.

Try DoCmd.GoToRecord , , acNewRec

Keith.
www.keithwilby.com
 

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