find upper case letters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

using sql or VB, how would I find out if the string in a field has any upper case letters?
 
What do want to do if you find one?

Jim
-----Original Message-----
using sql or VB, how would I find out if the string in a
field has any upper case letters?
 
If StrComp(MyString, LCase(MyString), vbBinary) = 0 Then
' no upper case in the string
Else
' upper case in the string
End If


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


putch said:
using sql or VB, how would I find out if the string in a field has any
upper case letters?
 
Putch

In VB you could try something like this (Warning: Untested Code follows)

Public Function HasUcase(strToTest) as Boolean
HasUcase = False
if strComp(strToTest,Lcase(strToTest),vbBinaryCompare) then
HasUcase = True
End If
End Function

It will return True if any character in the passed string is Uppercase, else
False when all of the characters are Lowercase.

Ron W
putch said:
using sql or VB, how would I find out if the string in a field has any
upper case letters?
 
Back
Top