Help with inserting symbols into text / memo fields using VBA

  • Thread starter Thread starter ghadley_00
  • Start date Start date
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)
 
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)
 
Back
Top