Detecting case in Access 2000

D

Del

What code can I use to detect whether the first 3 letters of a string are
upper or lower case?
 
D

Dirk Goldgar

Del said:
What code can I use to detect whether the first 3 letters of a string are
upper or lower case?


Something like:

If StrComp(UCase(Left(YourString, 3)), _
Left(YourString, 3), vbBinaryCompare) = 0 _
Then
' The first three characters are upper case (or not alphabetic).
ElseIf StrComp(LCase(Left(YourString, 3)), _
Left(YourString, 3), vbBinaryCompare) = 0 _
Then
' The first three characters are lower case (or not alphabetic).
Else
' The first three characters are mixed case (or not alphabetic).
End If


Now, I assumed that by "first 3 letters", you meant the first three
characters. If it's necessary to pull the first three alphabetic characters
out of the string, no matter where in the string they are, that has to be
done first, before checking their case.
 

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