if logic question

J

Junior

strSupv is a single character string value from 0 through 9 or A through R.
I want to test for strSupv values between "2" and and "I"
why doesn't the below code exclude strSupv value "O"?
thanks

If (strSupv > "1" And strSupv <= "I") And strPyPln <> "2" Then .....
 
A

Allen Browne

You have to be very careful with zero verses letter oh, and one verses
letter "i", but try this in the Immediate Window (Ctrl+G):
? ("O" > "1") And ("O" <= "I")
That should return False.

If not, you may need to look at the Option Compare statement in your module,
or the setting under Tools | Options | New database sort order.
 
J

Junior

Allen - thanks - the code returned false
but unfortunately, i don't know what to do with it - should my sample code
be working? or is there something i need to change?
 

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