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!

Concatenate

Status
Not open for further replies.

njwcad

Technical User
Oct 16, 2002
156
GB
Can anyone tell me if you can concatenate results from one control in a form with text on a label on the same form.

It would be very much appreciated

thanks
 
You can use the Caption property of a label to get the contents.
 
Remou

Thanks for your response. Unfortunately I don't think that I have explained my problem very well. So here goes for a second try.
I would like to define the text in a label based on the result of a control on a form so for example, if [Control A] = New York then I would have I like New York as text on my label. I have tried entering the following in the caption property of the label
"I Like"&"[Control A]" which results in the following label text;
I Like [Control A]

Being a novice, I'm not sure what to try next

Rgds
Njwcad


 
Ok. I guess you are setting this as the Control Source of some other textbox, so try:
[tt]="I Like " & [Control A][/tt]
If you are referring to the contents of a control or variable, you do not use quotes.
 
Assuming it is the label of the text box then simply\

Private Sub txtBxA_AfterUpdate()
txtBxA.Controls(0).Caption = "I Like " & txtBxA.Value
End Sub

If it is just any label

Private Sub txtBxA_AfterUpdate()
lblB.Caption = "I Like " & txtBxA.Value
End Sub

Your problem was that you put parentheses around [Control A].
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top