Phone input mask

B

BJC

Can someone recommend the best Phone No. input mask
that will include the POTENTIAL for an extension number.
Or should I create a separate field for the Extension (not my preferred
choice)
 
J

Jake

I'd go with 00000000009999 (assuming you're in the US).
That way the first 10 digits (i.e. 123-456-7890) are
always required, with 4 optional slots for spaces. Then
use a custom function to display (air code):

Function TelephoneDisplay(TelephoneNum as String)

Dim strXT as String

strXT = ""

If Len(TelephoneNum) > 10 Then strXT = " xt. " & _
Right(TelephoneNum,Len(TelephoneNum)-10)

TelephoneDisplay = "(" & Left(TelephoneNum,3) & ") " & _
Mid(TelephoneNum,4,3) & "-" & Mid(TelephoneNum,7,4) & _
strXT

End Function

HTH

Jake
 
Joined
Jun 24, 2005
Messages
8
Reaction score
0
How do I add a function to Access? Where do I type it in and where doI link it to specific data columns?
 
J

John Vinson

How do I add a function to Access? Where do I type it in and where doI
link it to specific data columns?

You create a new Module in the modules tab; edit the Function or Sub
in the VBA editor (hint: do not use the same name for the Function and
the name of the module).

Without knowing what you mean by "link it to specific data columns" I
can't advise. What does writing a module have to do with phone input
masks?

John W. Vinson[MVP]
 
Joined
Jun 24, 2005
Messages
8
Reaction score
0
I was trying to figure out how to implement functions-like Jake's-to modify inputted texts.
Thanks for the help.
 
Last edited:
Joined
Jun 24, 2005
Messages
8
Reaction score
0
I want to make a database set up such that when a user enters data into a certain text type cell - or when I do _______ - a function I wrote will format the text. e.g. User will input (a) name(s) and I will then be able to convert all the names in the DB to Xxxxxxx format. (I know, using mask ">L<CCCCCCCCCCCCCCCC" does this. I want MORE control.) How do I pull this off? Thanking you in advanced.
 

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