"&" as part of a Label Caption

sjr1917

Registered User.
Local time
Today, 08:19
Joined
Dec 11, 2012
Messages
47
I'm adding a field value (Addressee) to some text in a Label...
Label.Caption = "Initial text " & [Addressee]

Problem: If the name contains an ampersand, like "Joe & Sally" the "&" shows up as an underscore.
Tried to escape it... no joy
Tried "Joe " & Chr(38) & " Sally"... no joy

I can switch to a textbox with a background to match the form header (where it sets) and TabStop= No ... but just want to know if there's a work around for the Label issue??

Thanks
 
Yep! Thanks.
Where is that documented?
 
No problem. It's documented in Help on the Caption property on my PC (2007):


You can use the Caption property to assign an access key to a label or command button. In the caption, include an ampersand (&) immediately preceding the character you want to use as an access key. The character will be underlined. You can press ALT plus the underlined character to move the focus to that control on a form.

Include two ampersands (&&) in the setting for a caption if you want to display an ampersand itself in the caption text. For example, to display "Save & Exit", you should type Save && Exit in the Caption property box.
 
THANKS! From moment to moment with this software I feel on top of it and the next, like a complete dummy.
Searching high & low and forgot to check the obvious "Help, Caption" :o
 
Note that F1 will get you context-sensitive help in many areas of Access, including the properties window.
 

Users who are viewing this thread

Back
Top Bottom