form referencing

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
 
D

Dirk Goldgar

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top