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

TempVars concatenation not working

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
586
GB
Hello all.

I have a tempVar called TVarAddress

In a text box control source I have: = [TempVars]![TVarAddress]

The above works fine and returns for example "12 Cook Street"

I store all the TempVars names in a table.

I have a textbox on a form called TXTBOX1 which displays just the TempVar Name - ie. TVarAddress

I have another textbox called TXTBOX2 which has the control source set as:

=TEMPVARS!&[TXTBOX1]

I wanted this to display the TempVar Value(i.e. 12 Cook Street), but it does not.

I would appreciate any help. Thank you Mark


 
You can never use bang notation with variables.

This does not work
Code:
dim myControl as string
myControl = "textBox1"
msgbox me!myControl.name

You need to use dot notation
Code:
msgbox me.controls(myControl).name
That works

In your case tempvars.item(txtbox1)
And I believe since item is the default property you can just do
tempvars(txtbox1)
That is how you would do it in code, but not sure of the calculated control. Maybe
=tempvars([txtbox1])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top