Welcome to SPN

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

Sign Up Now!
  1. Monthly (Recurring) Target: $300 :: Achieved: $95   Become a Supporter    ::   Make a Contribution    Let's do it!

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
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page