Having a command button open form in ADD mode

S

Spidey3721

I am trying to get a command button on one of my forms to open another form
in ADD mode. I have gotten it to work by adding "acformadd" as an argument
(?) to the end of my DoCmd in Visual Basic. It works fine

DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd


QUESTION - Is this the only way to accomplish this, or is there an easier
way to set this up ?
 
R

Rick Brandt

Spidey3721 said:
I am trying to get a command button on one of my forms to open another form
in ADD mode. I have gotten it to work by adding "acformadd" as an argument
(?) to the end of my DoCmd in Visual Basic. It works fine

DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd


QUESTION - Is this the only way to accomplish this, or is there an easier
way to set this up ?

It's one line and it works. Just how much easier than that do you want?

You can set DataEntry to True in the form's design and make that the
default, but then you would need a line similar to above when you DON'T
want ADD mode.
 

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