Open form to new record

  • Thread starter Thread starter KS
  • Start date Start date
K

KS

What's the syntax to have a form open to a new record
rather then the default first record? I tried the
following but get a Run time error saying the action or
argument requires a Form Name argument:

Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm frmECTesting, acNormal, , , acFormAdd,
acWindowNormal
End Sub

By using the acFormAdd argument am I also dis-allowing
edits? I may or may not want to do this so how could I
code for either scenario?

As you can probably tell, I'm new to this stuff so every
detail helps. Thanks in advance.
 
I just use the following in my "onopen" event to maximize the form and go to
a new record...

<------------------------code------------------->
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
DoCmd.GoToRecord , , acNewRec
End Sub
<------------------------code------------------->

Rick
 
Thanks for the help
KS
-----Original Message-----
I just use the following in my "onopen" event to maximize the form and go to
a new record...

<------------------------code------------------->
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
DoCmd.GoToRecord , , acNewRec
End Sub
<------------------------code------------------->

Rick





.
 
Back
Top