Using "&" in a command button's caption

  • Thread starter Nicholas Scarpinato
  • Start date
N

Nicholas Scarpinato

How can I use a & in a command button's caption without Access treating it as
an underline symbol for the character immediately after it? The command
button caption I need is "AT&T".
 
G

Golfinray

The & symbol is reserved in access. You should not use it in a caption. Try +
instead.
 
B

BruceM

Just enter the ampersand twice: AT&&T
Having a symbol as part of a text string, including a caption, is perfectly
OK. Symbols shouldn't be used in field, control, or object names, but that
does not extend to captions.
 
J

John W. Vinson

How can I use a & in a command button's caption without Access treating it as
an underline symbol for the character immediately after it? The command
button caption I need is "AT&T".

Double it up:

AT&&T

in the caption property will display AT&T with no underline.

The underline actually represents a hotkey - e.g. if you caption a command
button

E&XIT

it will display with the X underlined (as you saw with AT&T), but this will
let the user click the button from the keyboard by typing alt-X.
 
N

Nicholas Scarpinato

I knew about the ALT+X keystroke with the &X, but I couldn't remember how to
get around that when I needed the & to display as a &. Thank you John and
Bruce.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top