Open form to new record

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.
 
R

Rick

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
 
K

KS

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





.
 

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