Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Jacksonville, North Carolina, USA
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Handling Mix Cases (2003 11.6566.8132 SP2)

    To reduce data entry person's keystokes is there a way to fill in a field in lower case yet have the result be case correct? Such as type: jason mcginity but the result will end up Jason McGinity? Or, type the address as 1121 mcenroe ct w/ the result as 1121 McEnroe Ct?

    I would rather not have all caps for it will be merged into a letter and want to avoid the appearance of YELLING.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Handling Mix Cases (2003 11.6566.8132 SP2)

    See the custom function by <!profile=MarkD>MarkD<!/profile> in <post:=309,766>post 309,766</post:>. Take note of the rermarks at the end.

    PS were the replies to recent questions such as <post:=652,055>post 652,055</post:>, <post:=650,468>post 650,468</post:> and <post:=644,687>post 644,687</post:> helpful? Since you didn't provide any feedback, other Loungers reading those thread don't know if the problem was solved.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Handling Mix Cases (2003 11.6566.8132 SP2)

    Very long piece of code moved to attachment by HansV

    If you create a table (tblTCase) with one field (TextCase) for exceptions like Mackenzie where you don't want to capitalise the 'k'.
    you can then call it in the before update event of a text box or in a report or query.
    Hope this is useful - I've spent years getting it just right. You'll need a reference to the DAO library.
    Attached Files Attached Files

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Handling Mix Cases (2003 11.6566.8132 SP2)

    Thanks for the code

    is there any advantage of your code verse ProperLookup function in Google NeatCode.mdb?

    John

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Handling Mix Cases (2003 11.6566.8132 SP2)

    What is Google NeatCode.mdb ?
    Regards
    John



  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Handling Mix Cases (2003 11.6566.8132 SP2)

    I don't think there *is* a Google Neatcode.mdb. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    There is one from Microsoft: ACC97: Neatcd97.mdb Available in Download Center, a database full of sample VBA routines. It was never updated for later versions of Access, but the samples work there too.

  7. #7
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Handling Mix Cases (2003 11.6566.8132 SP2)

    Sorry, it should of been if you Google NeatCode.mdb

  8. #8
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Jacksonville, North Carolina, USA
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Handling Mix Cases (2003 11.6566.8132 SP2)

    Thank you for the coding. However, I'm afraid it is over my head. I'm unsure what to do next with the coding.

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Handling Mix Cases (2003 11.6566.8132 SP2)

    You'd put the GetProperCase function in a module (created by clicking New in the Modules section of the database window).

    Then, you'd create an After Update procedure for each text box that you want to be "proper cased":
    - Open the form in design view.
    - Select a text box.
    - Activate the Event tab of the Properties window.
    - Click in the After Update event.
    - Select [Event Procedure] from the dropdown list.
    - Click the ... button to the right of the dropdown arrow.
    - Make the code look like this, with the appropriate text box name:

    Private Sub LastName_AfterUpdate()
    Me.LastName = GetProperCase(Me.LastName)
    End Sub

    I have attached a very simple demo database with a table tblData and a form frmData. If you enter a name or address in the form and press Tab, the contents will automatically be adjusted.
    Attached Files Attached Files

  10. #10
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Jacksonville, North Carolina, USA
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Handling Mix Cases (2003 11.6566.8132 SP2)

    Sweet. Thanks so much!

Posting Permissions

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