Help with inserting symbols into text / memo fields using VBA

G

ghadley_00

Hi,

I have a form with memo & text fields that get printed onto a report. I
would like to add buttons to my form which insert one of the following
symbols: ↑ ↓ ↠→ to a text or memo field when the button is
pressed.

At present I can manually insert these symbols by cutting and pasting
them from a word document. Would like to generate vba code to do this
instead.

I tried Me![text field]= Me![text field] + "↑ ↓ â†â†’" however,
when I try to enter the symbols into the vba editor they all change to
question marks.

Are there character codes for these symbols? Is there some other way I
can accomplish this feature?

Thanks,

George Hadley
(e-mail address removed)
 
J

John Nurick

Hi George,

Yes, the symbols have character codes. One way to get them is to use the
Windows Character Map applet (charmap.exe). If this shows a "Keycode",
you can use that, e.g. Chr(252); otherwise use the Unicode position,
e.g.
ChrW(&H2300) gives you the diameter symbol, U+2300.

Alternatively, select the character in Word and use something like
? AscW(Selection.Characters(1))
which will return the Unicode position as a decimal number.


Hi,

I have a form with memo & text fields that get printed onto a report. I
would like to add buttons to my form which insert one of the following
symbols: ? ? ? ? to a text or memo field when the button is
pressed.

At present I can manually insert these symbols by cutting and pasting
them from a word document. Would like to generate vba code to do this
instead.

I tried Me![text field]= Me![text field] + "? ? ? ?" however,
when I try to enter the symbols into the vba editor they all change to
question marks.

Are there character codes for these symbols? Is there some other way I
can accomplish this feature?

Thanks,

George Hadley
(e-mail address removed)
 

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