• formatting mixed-case textbox (2000/SP-3)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » formatting mixed-case textbox (2000/SP-3)

    Author
    Topic
    #435416

    I have an unbound text box on a form used for printing hard copies of cards used for filing purposes. The text box, which gets its data from 3 fields in the form’s underlying query, has its Control Source set to :
    =[LastName] & “, ” & [FirstName] & ” ” & [MiddleName]

    I would like to print the entire LastName field appearing in all capitals with the FirstName and MiddleName fields appearing in the normal mixed upper and lowercase. i.e.;
    JONES, James Earl

    Anybody out there have any suggestions?

    Viewing 0 reply threads
    Author
    Replies
    • #1029013

      try

      =UCase([LastName] )& “, ” & strconv([FirstName] , 3)& ” ” & strconv([MiddleName] ,3 )

      The UCase function converts to Upper Case

      The Strconver function will do a range of conversions. The 3 tells it to convert to Proper Case
      You could replace UCase in the above with another strconvert but use strConvert([Lastname],1)

      • #1029020

        John,
        Excellent! excellent! excellent! Many thanks. I appreciated the explanation too. I am obviously not a veteran. I found one little glitch in my records appeared when first or middle names were hyphenated. So, I changed your expression to:
        =UCase([LastName]) & “, ” & [FirstName] & ” ” & [MiddleName]
        …and now it works just fine.
        This also solved a similar problem when nicknames, that I have the habit of putting in parenthesis, were added. Since now the first letter of the name was actually the second letter of the word, it always appeared as lowercase… Just thought you might like to put that into your ‘bag of tricks’ for future reference. John, thanks again. Your lounge is great!
        Brady

        • #1029021

          OK so you want Smith-Jones to appear that way, and Strconv(“Smith-Jones”,3) gives you Smith-jones?

          I don’t know a way around that, but the Strconv is optional. I put it it in because it fixes mistakes in the way you enter names most of the time.

          • #1029029

            All is perfect now. Thanks again John.
            Brady

          • #1029056

            I don’t think there is a way around that. I don’t use the ProperCase because it just causes too many problems. McHenry gets changed to Mchenry, etc. I wrote my own function that more intelligently determines when something should be capitalized, and doesn’t uncapitalize anything that is already capitalized. It still fails on “e.e. cummings”, but we all have to live with that one! laugh

    Viewing 0 reply threads
    Reply To: formatting mixed-case textbox (2000/SP-3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: