Phone input mask

  • Thread starter Thread starter BJC
  • Start date Start date
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)
 
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
 
How do I add a function to Access? Where do I type it in and where doI link it to specific data columns?
 
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]
 
I was trying to figure out how to implement functions-like Jake's-to modify inputted texts.
Thanks for the help.
 
Last edited:
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.
 
Back
Top