Results 1 to 8 of 8
  1. #1
    samuelw
    Guest

    Title Case Input Mask

    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.

  2. #2
    dmatherton
    Guest

    Re: Title Case Input Mask

    My first reaction would be to try the following:

    >L_L<??????????

    Please note...

    1. The "_" in the mask above indicates a space, rather than an underscore.

    2. The "" in the mask indicates that the following character should be interpreted literally (ie forces a space between the first initial and the surname.

    3. The ">" 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.

  3. #3
    samuelw
    Guest

    Re: Title Case Input Mask

    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.

  4. #4
    2 Star Lounger
    Join Date
    Dec 2000
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Title Case Input Mask

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

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Title Case Input Mask

    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....
    <font color=448800>CompleteName: IIF([FirstInitial]="",[LastName],[FirstInitial] & ". " & [LastName])</font color=448800>
    -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 [img]/w3timages/icons/thinks.gif[/img]
    -MarkJ-

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

    Re: Title Case Input Mask

    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.
    Charlotte

  7. #7
    samuelw
    Guest

    Re: Title Case Input Mask

    To everyone who responded,

    Thanks for your help. It is greatly appreciated.

    Sam W.

  8. #8
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    St. Marys, Ontario, Canada
    Posts
    270
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Title Case Input Mask

    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?

Posting Permissions

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