Auto add . after Dr on Form

  • Thread starter Thread starter slagg7575
  • Start date Start date
S

slagg7575

Hi All!,

I asked a similar question before about capitalizing a name field in
Access that would have the format 'Dr. Smith' That worked fine with
this code Copies_To = StrConv([Copies_To], 3), my question is how do I
modify this to automatically add a period (.) after the Dr? Sometimes
the user will type dr smith, and Access with the code will change this
to Dr Smith, but I would like the period added after Dr, and not added
if the user types the period as in Dr. smith. Does this make sense?
Thanks alot!

Slagg
 
Use Replace function:

Copies_To = Replace([Copies_To], "Dr ", "Dr. ", 1, -1, vbTextCompare)
 
If you want to store the person't title of address, use a separate field.
Do NOT store "Dr" and "Smith" in the same column.
If your data is properly stored, you have very few problems keeping it
correct. In fact for a person's title, a combo box is preferred. That
eliminates the user's ability to enter an invalid or inconsistant value.
 
Back
Top