form referencing

  • Thread starter Thread starter JohnE
  • Start date Start date
J

JohnE

I have two forms: form1 and form2. Form1 has a label on it with a double
click event. This double click event closes form1 and opens form2. I have
the closing and the opening working. On form2 there is a button that needs
to become visible. The line that is failing is the following

Forms.frmSplashScreen.btnCloseSplashScreen.Visible = True

The error message is "Application-defined or object-defined error"

What am I missing in this line?

Thanks... John
 
JohnE said:
I have two forms: form1 and form2. Form1 has a label on it with a double
click event. This double click event closes form1 and opens form2. I
have
the closing and the opening working. On form2 there is a button that
needs
to become visible. The line that is failing is the following

Forms.frmSplashScreen.btnCloseSplashScreen.Visible = True

The error message is "Application-defined or object-defined error"

What am I missing in this line?


You have at least one "dot" (.) where you need a "bang" (!). Try this:

Forms!frmSplashScreen!btnCloseSplashScreen.Visible = True

Naturally, this line should only be executed after frmSplashScreen has been
opened.
 
Back
Top