Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Close one form and open another

Discussion in 'Information Technology' started by millie.patel@gmail.com, Jul 28, 2006.

Tags:
  1. millie.patel@gmail.com

    millie.patel@gmail.com
    Expand Collapse
    Guest

    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!
     
  2. Loading...

    Similar Threads Forum Date
    India Who says we have skeletons only in our closets? Breaking News Aug 22, 2014
    India After Badrinath, Kedarnath now Sikh shrine Hemkunt Sahib closed temporarily Breaking News Jun 28, 2013
    Grammer / Vyakarn Fateh multimedia forced to close for lack of funds Language, Arts & Culture Nov 21, 2012
    General The Closer Videos Jul 26, 2012
    Close Brush with the Law, a Personal Story Business, Lifestyle & Leisure Sep 24, 2011

  3. SusanV

    SusanV
    Expand Collapse
    Guest

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

    <millie.patel@gmail.com> wrote in message
    news:1149619761.455571.146960@j55g2000cwa.googlegroups.com...
    > 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!
    >
     
  4. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

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

    DoCmd.OpenForm "frmCMProductsAdd"
    --
    Good Luck
    BS"D


    "millie.patel@gmail.com" wrote:

    > 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!
    >
    >
     
  5. millie.patel@gmail.com

    millie.patel@gmail.com
    Expand Collapse
    Guest

    THANKS :)

    Ofer Cohen wrote:
    > If the frmCMProductsAdd is the form name, you need to add double quote before
    > and after the name
    >
    > DoCmd.OpenForm "frmCMProductsAdd"
    > --
    > Good Luck
    > BS"D
    >
    >
    > "millie.patel@gmail.com" wrote:
    >
    > > 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!
    > >
    > >
     
  6. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    SusanV wrote:
    > 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"

    --
    Rick Brandt, Microsoft Access MVP
    Email (as appropriate) to...
    RBrandt at Hunter dot com
     
  7. SusanV

    SusanV
    Expand Collapse
    Guest

    Thanks for setting me straight - always good to learn!

    ;-)

    "Rick Brandt" <rickbrandt2@hotmail.com> wrote in message
    news:cnlhg.39740$4L1.5340@newssvr11.news.prodigy.com...
    > SusanV wrote:
    >> 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"
    >
    > --
    > Rick Brandt, Microsoft Access MVP
    > Email (as appropriate) to...
    > RBrandt at Hunter dot com
    >
     

Share This Page