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

Concatinate an Object Name with String Variable 1

Status
Not open for further replies.

tomhughes

Vendor
Aug 8, 2001
233
US
tomhughes (Vendor) 16 Feb 07 9:38
I am trying to concatenate an object name with a string Variable. The last letter of the Text Box name changes. If I hard code the letter in the name the string returns the proper value.

This text string returns the proper value.

Code:
str = " '" & Forms!frmMain.TopicHead[b][COLOR=red]A[/color] [/b]& "'"

I need to use a string variable to change the last letter of the name.
I have tried numerous string arrangements, with no success, it would seem to me that this string arrangement should work.

Code:
strTabNo = "A"
str = '" & Forms!frmMain.TopicHead & strTabNo & "'"

but it gives me the following error

Run-time error '2465'
Application-defined or object-defined error

There has got to be a way of doing this. Does anyone know how???

 
strTabNo = "A"
str = "'" & Forms!frmMain.Controls(TopicHead & strTabNo) & "'"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV
THANKS!THANKS!THANKS!THANKS!THANKS!THANKS!THANKS!THANKS!

I had to put quotes around the word TopicHead. I've been working on this for days, pulling my hair, and don't have much to pull out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top