Stupid Code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric

    Stupid Code

    When trying to call form 2 with form2.show or form2.show = true I get this
    error

    Run-Time error '424':
    Object Required

    I am trying to call form 2 from form 1. I am placing the code in the
    command button. Am I placing the code in the wrong location?

    Thank you
    Eric in Tampa


  • dfg

    #2
    Re: Stupid Code

    Eric wrote:[color=blue]
    > When trying to call form 2 with form2.show or form2.show = true I get this
    > error
    >
    > Run-Time error '424':
    > Object Required
    >
    > I am trying to call form 2 from form 1. I am placing the code in the
    > command button. Am I placing the code in the wrong location?
    >
    > Thank you
    > Eric in Tampa
    >
    >[/color]

    Ok. Let's start from the beginning.

    Start a new form. We'll keep the default name of Form1.
    Add a button. We'll call it cmdShowForm2, with a caption of "Goto Form2"
    Double click on this button to get into the subroutine; Or just open the
    code window and write Private Sub cmdShowForm2_Cl ick().
    Under that line add the code: Form2.Show
    Now we have to add another form. Let's do that now. I'll assume you
    know how. Keep the default name of Form2.
    In that new form add a button. We'll call the new button cmdShowForm1.
    The Caption can be Goto Form1.
    Double click on this button to get into the procedure called
    cmdShowForm1_Cl ick() and add the following:
    Form1.show

    Now try to run the program. If this doesn't work then there may be a
    problem with your installation.

    Comment

    • dfg

      #3
      Re: Stupid Code

      dfg wrote:[color=blue]
      > Eric wrote:
      >[color=green]
      >> When trying to call form 2 with form2.show or form2.show = true I get
      >> this
      >> error
      >>
      >> Run-Time error '424':
      >> Object Required
      >>
      >> I am trying to call form 2 from form 1. I am placing the code in the
      >> command button. Am I placing the code in the wrong location?
      >>
      >> Thank you
      >> Eric in Tampa
      >>
      >>[/color]
      >
      > Ok. Let's start from the beginning.
      >
      > Start a new form. We'll keep the default name of Form1.
      > Add a button. We'll call it cmdShowForm2, with a caption of "Goto Form2"
      > Double click on this button to get into the subroutine; Or just open the
      > code window and write Private Sub cmdShowForm2_Cl ick().
      > Under that line add the code: Form2.Show[/color]

      Sorry. If you added this code manually, you'll also need a line named
      End Sub underneath this line.
      [color=blue]
      > Now we have to add another form. Let's do that now. I'll assume you
      > know how. Keep the default name of Form2.
      > In that new form add a button. We'll call the new button cmdShowForm1.
      > The Caption can be Goto Form1.
      > Double click on this button to get into the procedure called
      > cmdShowForm1_Cl ick() and add the following:
      > Form1.show
      >
      > Now try to run the program. If this doesn't work then there may be a
      > problem with your installation.
      >[/color]

      Comment

      Working...