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

dynamically updating variable in different form

Status
Not open for further replies.

astraltango

Programmer
Joined
Nov 19, 2003
Messages
18
Location
AU
ok, I have two forms: Form1 and Form2

I want to set a puiblic variable (str1) in Form1 from Form2. Works fine if I use the following:

Forms!Form1.str1 = "blah"

BUT, I need to do this dynamically where the form name is in a variable. For this I need the eval function right? But this does not seem to work despite there being no errors:

str2 = "Form1"
Eval "Forms!" & str2 & ".str1 = ""blah"""

In fact, I've found that not even this will work:

Eval "Forms!Form1.str1 = ""blah"""

Any ideas how I can accomplish this?
 
Don't know about the Eval function, but referring to forms dynamicly, can be performed like this (here also using your public):

[tt]Forms(str2).str1 = "blah"[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top