Chr Function syntax

J

Jim

I am trying to add a special character to a text string using code. I have the unicode tag for my character, but cannot seem to get it to work. Can anyone give me some syntax advice?
 
D

Dirk Goldgar

Jim said:
I am trying to add a special character to a text string using code.
I have the unicode tag for my character, but cannot seem to get it to
work. Can anyone give me some syntax advice?

If you have the unicode value, use the ChrW() function instead of Chr().
 
W

Wayne Morgan

This is just a quick test from the immediate window. Is this what you're
after?

?"string" & ChrW(0176) & "string"
string°string

--
Wayne Morgan
Microsoft Access MVP


Jim said:
I am trying to add a special character to a text string using code. I
have the unicode tag for my character, but cannot seem to get it to work.
Can anyone give me some syntax advice?
 
J

Jim

Thanks Guys, that looks great, one problem is that when I include letters in the unicode it busts. I am referencing a unicode list online, perhaps that is the problem. Note my code below:

Me!QuestSkipto = Me!QuestSkipto & ChrW(25B6) & " " & "Goto Q000" & vbCrLf
 
D

Dirk Goldgar

Jim said:
Thanks Guys, that looks great, one problem is that when I include
letters in the unicode it busts. I am referencing a unicode list
online, perhaps that is the problem. Note my code below:

Me!QuestSkipto = Me!QuestSkipto & ChrW(25B6) & " " & "Goto Q000" &
vbCrLf

"Letters in the unicode"? These should be numeric values. Is your list
giving you hexadecimal codes by any chance? Are you looking for the
character ? , which may or may not appear correctly in this posted
message but is a sort of right-pointing arrowhead? If so, your list is
giving you hexadecimal values and you can specify them in your code like
this:

Me!QuestSkipto = Me!QuestSkipto & _
ChrW(&H25B6) & _
" Goto Q000" & vbCrLf
 

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