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.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Title Case Input Mask
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.
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.
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-
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.
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?
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications