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

How to put a variable in the form reference 2

Status
Not open for further replies.

JasGrand

Programmer
Jan 8, 2003
144
CA
Hello, I was wondering if anyone could tell me how to put a variable in a form reference?

Example:
strA = intForm + 1
strA = "Add_" + strA

Forms!strA.Controls!lblTitle.Caption = Forms!strB.Controls!lblTitle.Caption

I was wondering if this is the right approach to do this or if anyone knows of a better way... Any help is appreciated.

Thanks,


Jason
 
I'm not exactly clear as to what it is you want or are doing...

Are you trying to use a caption from one from for use on another form?

 
Hi Jason,

If I understand what you are trying to do correctly, then try using a slightly different syntax:

Code:
Forms(strA).Controls!lblTitle.Caption = Forms(strB).Controls!lblTitle.Caption

Enjoy,
Tony
 
Hello, thanks for answering. I ended up figuring out a different way of handling this.

Since you both answered, you both will get my vote.

Thanks again,


Jason
 
For furture reference, could you post your solution to this problem?

Also, another possible so,ution would be to use the Evaluate function to evaluate the form name string.

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Hello Tarwn, I just used a global variable to save the caption of the form (when you would push the next button to go to the other form). Then on the form load of the new form, I just grabbed the global variable and set the title of the new form.


simple solution...


Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top