How to determine if field is all uppercase?

  • Thread starter Thread starter majobojrod
  • Start date Start date
M

majobojrod

I know how to convert fields to all uppercase, all lowercase, or to mixed
case, but how can you determine if a field is all uppercase, or all lowercase?
 
Type an expression like this into the Field Row in query design,
substituting your field name for f1:

IsUpper: IIf([f1] Is Null, Null, StrComp(StrConv([f1], 1), [f1], 0) = 0)

If you are trying this in VBA, use IsNull() instead of Is Null, and use
vbUpperCase and vbBinaryCompare for the arguments.
 
Couldn't that exprsssion be simplified by removing the IIF? StrComp and
StrConv both handle nulls and if F1 is null the expression below will return
Null

IsUpper: StrComp(StrConv([f1], 1), [f1], 0) = 0

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Allen Browne said:
Type an expression like this into the Field Row in query design,
substituting your field name for f1:

IsUpper: IIf([f1] Is Null, Null, StrComp(StrConv([f1], 1), [f1], 0) = 0)

If you are trying this in VBA, use IsNull() instead of Is Null, and use
vbUpperCase and vbBinaryCompare for the arguments.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

majobojrod said:
I know how to convert fields to all uppercase, all lowercase, or to mixed
case, but how can you determine if a field is all uppercase, or all
lowercase?
 
Back
Top