Results 1 to 12 of 12
  1. #1
    Troubled is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2015
    Location
    Cambodia
    Posts
    9

    Smile Altering people's data input from lower to upper case

    As a complete novice to Access 2003 I am finding it hard going. I have a database containing a mixture of upper and lower case input. I can make upper case appear on the screen by using > in the format box in the property section for each field. This works great but the same old uncorrected stuff remains on the database. How can I get the database to store the corrected upper case data after I have entered it in lower case? Thanks for your help

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    That will require code (macro or VBA) to save the formatted text. Example:

    Private Sub tbxFieldNum_AfterUpdate()
    Me.tbxFieldNum = UCase(Me.tbxFieldNum)
    End Sub

    Use an UPDATE sql action to correct the existing data.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    does it matter? - users should only be using forms and reports so you can just use the > for formatting. Access isn't case sensitive so Mr=mr=MR

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    Quote Originally Posted by Ajax View Post
    does it matter? - users should only be using forms and reports so you can just use the > for formatting. Access isn't case sensitive so Mr=mr=MR
    If Option Compare is set to Option Compare Binary, Access is case sensitive. If it is not specified, the default is binary.

  5. #5
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Sorry, thought you were using Access, not VB

    If you are using access, you might want to look at this link

    http://www.fmsinc.com/microsoftacces...ons/index.html

  6. #6
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    Quote Originally Posted by Ajax View Post
    Sorry, thought you were using Access, not VB
    If you are referring to me, I am using Access and Access VBA. I think the original poster is using Access too, according to their profile.

  7. #7
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    @Micron, I was referring to your comment

    If it is not specified, the default is binary.
    which is true for VB but not access

  8. #8
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    these indicate otherwise, unless I have mis-interpreted the articles. While the first may appear to be applicable to Visual Studio, the title and article text refer to Access and VBA. In fact, tip #3 in the link you sent confirms this. Please explain why then, you say Access is not case sensitive? Or did you mean that it is not "usually" used in a case sensitive context?

    https://msdn.microsoft.com/en-us/lib...=vs.60%29.aspx
    https://support.microsoft.com/en-us/kb/98227
    http://www.fmsinc.com/microsoftacces...ons/index.html

  9. #9
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    I never said Access is not case sensitive and I never said that it couldn't be case sensitive, I just don't agree that that it's default position is case sensitive. Whether you have misinterpreted the articles, that is for you to decide, it is an easy enough thing to test.

    whenever you create a new module in access, the default is Option Compare Database (i.e. not case sensitive) - although don't forget this only affects vba code, SQL remains case insensitive - unless you use something like the StrComp('myText1', 'MYTeXt1', 0) function where 0 instructs a binary (i.e. case sensitive) comparison

  10. #10
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    Sorry, I thought it was you that said "Access isn't case sensitive so Mr=mr=MR"
    I can definitely say I did not say it was case sensitive by default. I said if "it" (Option Statement) is not specified, the comparison is case sensitive by default. To quote Microsoft: Function FindEm (mystr$)
    FindEm = InStr(1, mystr$, "C")
    End Function
    If mystr$="1<space>abc<tab>ABC", the function will return the following results, depending on which Option Compare statement is used: Option Compare Database: 5
    Option Compare Text: 5
    Option Compare Binary: 9

    BTW, I believe it was a Microsoft page that stated it defaults to binary if the statement is missing. I've never tested it.

  11. #11
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Sorry, I thought it was you that said "Access isn't case sensitive so Mr=mr=MR"
    I did - but was talking about the default position - I was not talking about ways round it

    it defaults to binary if the statement is missing
    I agree with that, but the default position is that Option Compare Database is used in access vba (nothing in vb)

    I think we are really talking about what is the default position - I'm talking about the position if the user does nothing, you are talking about the position if there is no 'option compare' statement.

  12. #12
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    Quote Originally Posted by Ajax View Post
    I did - but was talking about the default position - I was not talking about ways round it

    I agree with that, but the default position is that Option Compare Database is used in access vba (nothing in vb)

    I think we are really talking about what is the default position - I'm talking about the position if the user does nothing, you are talking about the position if there is no 'option compare' statement.
    10-4! we seem to agree that Access and VBA for Access can be made to compare as binary (hence upper case / lower case) if one controls the settings.
    Thanks for everything!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 10-23-2012, 03:55 PM
  2. Upper & Lower Case in table
    By Forums10 in forum Access
    Replies: 4
    Last Post: 01-31-2011, 09:01 AM
  3. Is there a way to force a field do be upper case?
    By newtoAccess in forum Access
    Replies: 1
    Last Post: 11-28-2010, 04:20 PM
  4. Forcing text to upper case
    By barrettp in forum Forms
    Replies: 10
    Last Post: 06-01-2010, 09:44 AM
  5. Converting all text input to lower case
    By aommaster in forum Forms
    Replies: 6
    Last Post: 08-05-2009, 05:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums