Damn ampersand

  • Thread starter Thread starter Luke Bellamy
  • Start date Start date
L

Luke Bellamy

I have a label on a report that I set through VBA to be a user entered
value. When they put an ampersand (&) as the value the text in the
label shows up with the underscore (_) instead. I understand this but
I need to know how to escape the special chars so they show regardless.

Thanks
 
Hi Luke,

As you know, you have to use two & in a label or caption to have it display
a single &; i.e., to get Smith & Jones, you have to enter Smith && Jones.
So, how about after the user enters their label value, run it through the
Replace() function to replace & with &&?

regards,
 
Put the user's input through the Replace() replacing "&" with "&&".

Alternatively, use a TextBox instead of a Label.
 

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

Back
Top