Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing Variables

Status
Not open for further replies.

Fboo

Programmer
May 6, 2003
13
CA
Good Day,

Does anyone know if it is possible to reference a variable of one form module from another form module? And if so, how?

For example, I know you can do this to access a textbox in another form.

Form_frmFormName.txtTextBoxName

But I would like to know how to access a variable.

Thanks in advance! :eek:)
 
Thanks Paul but I'm sorry, I don't understand. How would I do that? I have declared the variable in the General Declarations as a global variable (I believe that's what it's called).

For example:

Option Compare Database
Option Explicit
Dim blnAnswer As Boolean

What I would like to do is access blnAnswer from another form module.

Thanks again.
 
I think that you can only get the variable value from another form only if that form is still open.

Variable in form in which value is set should be declared as
Public blnAnswer As Boolean

and should not be redeclared in your other form (the one that retrieves the value & uses it)

 
Thanks to all of you for your quick responses. It's worked! I should have come to you earlier! ;o)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top