Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA code for special characters 2

Status
Not open for further replies.

Duncanmcl

Programmer
Dec 23, 2000
61
US
Word defines the black down point triangle special character as alt X, or using character code 25bc. I'm trying to use same is Access in VBA, within an if statement on a procedure for streaming stock quote, that character being used as a negative if the change in stock value was negative. In Access using char(25bc) but get error....other has said char(9660) should work...but no...I get "?". How dor I display that character in Access VBA code??

Thanks in advance!!
 
this is a pay for service...answer service....its $12/mth....I also searched on google and MSDN.....they illustrate only the most simple of examples....please try again
 
Obviously "25bc" is meaningless in VBA. First, here are common character representations:

I didn't see the character you want there; try copying it from character map (if you are a windows user) and evaluating it in code.

Sure, the early bird gets the worm, but the second mouse gets the cheese in the trap.
 
this is a pay for service...

Scroll to the bottom of the page for an example.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
that example works to 255....and the down arrow is not within that range.....and #'s beyond that are not supported....to better see my example....go to word....insert....symbol....and scroll down to black down arrow....that the one...its supported in word as alt x 25b2.....but im trying to use it within Access in VBA code?

Thanks for trying!!
 
(tested)
Insert your special character into a table. e.g.
[tt]ID Value
1 £
2 €[/tt]

Do a Dlookup to get the value that you want and concatenate it with your answer.
Code:
chrEuro = DLookup ("[Value]", "[table2]", "[Id] = 2")
chrPound = DLookup("[Value]", "[table2]", "[Id] = 1")
There are probably other ways as well.



Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Don't forget Charmap: choosing Start->Run and type Charmap should bring it up. You can get special characters using special fonts.
 
Traingamer:thanks...getting closer... As suggested , created table like your example, ID 1 value is ?, id 2 value ?, value is a text field....the below dlookup yields ?? , both SUp and SDown are strings....when viewing table the arrows are OK....from code getting ??

SUp = DLookup("value", "unicode", "[ID]= 1")
SDown = DLookup("value", "unicode", "[ID]= 2")

MsgBox SUp & SDown

your thoughts?
 
I use that code in a query or form and get the proper character(s). I am returning the value to a text box or to a query. I am using a variant rather than a string but that shouldn't make a difference.
Code:
Public Function getTest(intId As Integer) As Variant

getTest = Nz(DLookup("[Value]", "[table2]", "[Id] = " & intId), "")
 
End Function
VarUp = getTest(1)
Print or debug.print gives me a question mark rather than the triangle though.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Traingamer:thanks....IT WORKS CORRECTLY....WELL DONE....THE LAST ERROR (MINE) WAS DLOOKUP TABLE WAS WITHOUT []'S....

You are my hero!!
 
And what about simply ChrW(&H25bc) ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHY: Your answer is what I was expecting..the other was a workarount..very limited description on the web about function chrw(), it clearly works...and is more logical for coding.....can you advise what its code means, concatenate hex? the following? into function CHRW()

 
I knew there had to be an easier way [smile]

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top