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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refer to variable in another form

Status
Not open for further replies.

ronphx

Programmer
Jun 24, 2004
64
US
Is there a way to refer to a variable that was created in another form that is open? Say variable "VAR" was created in form1. If I am in form2, how would I find the value of VAR? Something like?

a = forms!form1.var

Thanks.
 
Just like that. But I think the variable will need to be declared in the declaration section of the form module, using the public keyword.

Roy-Vidar
 
Thanks. I didn't have it declared as public, and I used a private sub.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top