Auto add . after Dr on Form

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
 
K

Ken Snell \(MVP\)

Use Replace function:

Copies_To = Replace([Copies_To], "Dr ", "Dr. ", 1, -1, vbTextCompare)
 
P

Pat Hartman \(MVP\)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top