if a character is a letter...

lala

Registered User.
Local time
Today, 13:58
Joined
Mar 20, 2002
Messages
741
how do i put it in the search?

if the 3rd character is a letter, then...

thank you
 
will
IIf(Not IsNumeric(Mid([bookname],3,1)),"Y","N")
or something similar work for you

Brian
 
thank you so much!!!
didn't know this was even a function
 
Hi -

If you need to be a little more concise, give this a try:

Code:
Function IsAlpha3(pchr As Variant) As Boolean
   IsAlpha3 = Switch(Asc(pchr) >= 65 And Asc(pchr) <= 90, True, Asc(pchr) >= 97 And Asc(pchr) <= 122, True, True, False)
End Function

you can call it from the debug (immediate) window with:

? IsAlpha3("p")
True
? IsAlpha3("$")
False
? IsAlpha3(9)
False

This will limit it to a - z and A - Z, anything else (numbers, other characters) will return False.

Bob
 
thank you!!
i don't know what concise means lolol
is the the right way of doing it, or more precise or...?
 
Good old Bob coming up with the correct solution, I'd kinda assumed certain things, naughty of me really, sorry Lala.

Brian
 
Isn't Alpha3 where Kirk bit the dust?
 
it's ok, but why do you say sorry? your solution doesn't work?
i ended up doing a workaround, because i was late with this project

but i was going to use yours in the future
 
I said sorry because it was not the most accurate solution, although I bet it works for your needs, but would fail if say, $ or space was in third position as it would say it was a letter ie non numeric.

Brian
 
ohhh, i see
and yes, for my needs it's perfect

but i see what you're saying
if i had other characters in the field, then it might miss some, right?

thank you, all!!!!!!!!!!!
 

Users who are viewing this thread

Back
Top Bottom