Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Identifying lowercase characters in a field

Identifying lowercase characters in a field

Identifying lowercase characters in a field


I need to search a field in a table and locate/identify any records containing lowercase characters. I will be making a table of these records.

If you know how I can do that, I would greatly appreciate your help.

Using Access 2002.


RE: Identifying lowercase characters in a field

You might need to loop through the characters of the field and check for ASC(...) between 97 and 122.

If you want more specific help, please provide table and field names as well as sample records and results.

Hook'D on Access
MS Access MVP

RE: Identifying lowercase characters in a field

Aside from identifying lowercase characters in a field, would you mind telling us why you want to make a table of these records? Are you going to COPY the records? (bad idea, IMHO) Or MOVING them into another table? Would it be easier to just mark the records with the lowercase characters by using another field in the table? No copying / moving records required.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.

RE: Identifying lowercase characters in a field

Instead of looping through character by character you could define a VBA function as follows:


Public Function HasLowerCase(strTest As String) As String
    If (0 = InStr(1, strTest, UCase(strTest), vbBinaryCompare)) Then
        HasLowerCase = "Y"
        HasLowerCase = "N"
    End If
End Function 

Then in your query add a column HasLowerCase([testfield]) with a criterion of "Y" where testified is the name of the field to be tested.
Using the InStr function should be faster than a VBA loop.

RE: Identifying lowercase characters in a field

You can do this with a query.

SELECT StrComp(UCase([MyField]),[MyField],0) AS test FROM MyTable WHERE (((StrComp(UCase([MyField]),[MyField],0))=True));

Using an = to compare the two won't work, but the Strcomp function does throw a true if the two text values don't match case sensitive.

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That DonÆt.


RE: Identifying lowercase characters in a field

Thanks for your input, I went with BLORF's solution. Worked like a charm thank you.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close