Close one form and open another

M

millie.patel

Hi All-

I am working with forms right now and would like the user to be able to
click the "Save and Add" button and be able to close out of the current
form they are in, and open a new form.

No values need to be passed from one form to the next.

I am trying this:
DoCmd.Close acForm, "frmCMProjectsAdd"
DoCmd.OpenForm frmCMProductsAdd

So once the user has added a project using frmCMProjectsAdd, I want
them to be able to open the frmCMProudcts

However I get the error: The action or method requires a Form Name
argument

Any thoughts/suggestions?

Thanks!
 
S

SusanV

You need to open the other form, before closing the current one - once the
form closes the code ends
 
G

Guest

If the frmCMProductsAdd is the form name, you need to add double quote before
and after the name

DoCmd.OpenForm "frmCMProductsAdd"
 
M

millie.patel

THANKS :)

Ofer said:
If the frmCMProductsAdd is the form name, you need to add double quote before
and after the name

DoCmd.OpenForm "frmCMProductsAdd"
 
R

Rick Brandt

SusanV said:
You need to open the other form, before closing the current one -
once the form closes the code ends

Incorrect. That is true of code that closes the app, but not of code that
closes a form. The following works just fine...

DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "FormName"
 

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

Similar Threads


Top