Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input Mask for Names 1

Status
Not open for further replies.

ngardner

Technical User
Apr 1, 2002
35
0
0
AU
I am creating a database using Access2000. I want to create an input mask that makes you save a person's name in the following format:
Jones, A
Any help would be appreciated.
Narelle
 
Narelle, the problem is that an Input Mask limits the number of Letter or Digits that you can enter. If all your values were 5 letters and then the comma and then an initial, it would be fairly easy but I assume that that isn't the case. You might want to look at Validation Text to see if that could help. Ultimately, it is probably not something you can force in just one field. You might be able to concatentate the values by using a LastName Field and then a First Initial field that limits you to 1 Character. You could do that with an Input Mask. Then put them together
LastName & "," & FirstInitial


Paul
 
Paul deserves a star for suggesting that you use two fields. It is seldom a good move to place two values into one field. Separate fields for Last and First Names is always a good investment.

Duane
MS Access MVP
 
It is always good practice to store first namd and surname seperatly. You might want to check out the Ltrim, Rtrim and Trim functions that will allow you to extract the initial when needed



Neil Berryman
IT Trainer
neil_berryman@btopenworld.com
 
Trim functions only remove leading or trailing spaces. Left(), Right(), and Mid() functions can extract parts of strings.

Duane
MS Access MVP
 
Thank you all for your help. I will make two columns for the name.
Thanks again!
 
Duane is right, I had a senior moment

Neil Berryman
IT Trainer
neil_berryman@btopenworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top