on open do to new record

C

Chris

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
 
Top