• Title Case Input Mask

    Author
    Topic
    #1767993

    Is there an input mask I can use that will serve the same function as Title Case in Word? I need to enter the first initial and last name in one field.

    Thanks,

    Sam W.

    Viewing 1 reply thread
    Author
    Replies
    • #1777111

      My first reaction would be to try the following:

      >L_L” at the start forces the first three characters into uppercase (to simulate title case) and the “<" resets the rest of the characters to lower case.

      4. Finally, you will need to include enough "?" characters in your mask to fill the rest of your field (check field size in Table Design).

      This should work OK for your particular example (initial and Surname), but is pretty clunky.

      Hope this helps.

      D.

      • #1777131

        David,

        Thanks for your response. I tried it but it doesn’t give me exactly what I need. I normally enter the last name only, and used a mask similar to yours, but when I have two people with the same last name I obviously enter their first initial before the last name. In order to do that I use no input mask and just type in the information manually. Your suggestion works if I always enter a first initial, which I don’t always need. Title Case in Word would work great, so I’m still looking for something that will do the same thing in Access. Seems a little tricky!

        Thanks again,

        Sam W.

        • #1777132

          You could always enter them in lower case then use an update query with the strconv function to put them in title case.

        • #1777135

          It’s generally a good idea to store First names (or initials) and Last names in separate fields. It helps keep things cleaner and more optimized in the long run – not to mention that it follows the rules of Data Normalization.

          I realize it may be more work to enter two fields, but it’s usually worth the extra trouble to have them separate.

          When you need to sort by last name and first initial (if present) you could use a query. The field could read something like….
          CompleteName: IIF([FirstInitial]=””,[LastName],[FirstInitial] & “. ” & [LastName])
          -where [FirstInitial] and [LastName] are your fieldnames for the appropriate fields. This statement will check to see if there is a first initial entered. If so, you’ll get something like: J. Doe. Otherwise you’ll just get Doe.

          If you decide to use a field to sort alphabetically you’ll need to modify the syntax to put last name first, then first initial.

          HTH
          -MarkJ-

        • #1777174

          You can also use the StrConv() function to convert the text to proper case in the AfterUpdate event of the control, but it sounds like you need to look at your table structure. Mixing types of information in a field is a bad idea over the long term, and that’s what you’re doing. It’s perfectly possible to have several people with the same name in your database. That’s one of the best arguments for not using things like a name as the primary key in the table. Use an autonumber or some other unique value as your primary key and you can have as many “John Doe” entries as you need. You’ll keep them straight by other correlary information anyhow.

          • #1777220

            To everyone who responded,

            Thanks for your help. It is greatly appreciated.

            Sam W.

    • #1777246

      Here is an example of title case that I have been struggling with for years. I would like to type in a field the addresses:

      15 Elm Street
      22 rue de la Montagne

      What I would like is that the “E” on Elm and the “S” on Street be upper case and all others become lower case.
      However, I would like the option to change the first letter to lower case as in the second address, so that the “r” in rue, the “d” in de and the “l” in la are not upper case.

      I used an accounting package called Bedford and it had this option. When you held down the shift key and typed the first letter,it toggled it to lower case, otherwise the convention was that each first letter was capitalized.
      Is it possible to do this in Access?

    Viewing 1 reply thread
    Reply To: Title Case Input Mask

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

    Your information: