Close one form and open another

  • Thread starter Thread starter millie.patel
  • Start date Start date
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!
 
You need to open the other form, before closing the current one - once the
form closes the code ends
 
If the frmCMProductsAdd is the form name, you need to add double quote before
and after the name

DoCmd.OpenForm "frmCMProductsAdd"
 
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"
 
Back
Top