Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Testing for all uppercase (Access 2003)

    Can anyone tell me how I can test if a field is all uppercase. I have a table where a few group have entered most of their data all in uppercase and I want to change only those to mixed case. I have a routine that changes every record but I want to be able to test if the row is completely uppercase and change only these rows.

    e.g.
    HCRA - Covered Lives Assessment - will be skipped
    HCRA - COVERED LIVES ASSESSMENT - will be changed to Hcra - Covered Lives Assessment
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Testing for all uppercase (Access 2003)

    You need a module with Option Compare Binary at the top, because this affects all code in that module. Then add this function and you can call it from anywhere in the app:

    <code>Public Function IsUpperCase(ByVal strTest As String) As Boolean
    IsUpperCase = (strTest = UCase(strTest))
    End Function</code>

    You would use it by using the IsUpperCase function in a calculated expression in your update query , like <code>Expr1: IsUpperCase([MyField])</code> and setting the criteria line below it to True
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testing for all uppercase (Access 2003)

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> Charlotte,

    Works beautifully.
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •