Access Input Mask for phone number

  • Thread starter Thread starter Bruce
  • Start date Start date
B

Bruce

What is a phone number input mask that would result in the first case
916.723.5828 and second case if 916 is not entered 723.5828 notice the first
"." is left off.
 
Bruce said:
What is a phone number input mask that would result in the first case
916.723.5828 and second case if 916 is not entered 723.5828 notice the
first
"." is left off.
 
Bruce said:
What is a phone number input mask that would result in the first case
916.723.5828 and second case if 916 is not entered 723.5828 notice the
first
"." is left off.

This might work for formating the display:

Public Function FormatPhone(strIn As String) As Variant
On Error Resume Next

If InStr(1, strIn, "@") >= 1 Then
FormatPhone = strIn
Exit Function
End If

Select Case Len(strIn & vbNullString)
Case 0
FormatPhone = Null
Case 7
FormatPhone = Format(strIn, "@@@.@@@@")
Case 10
FormatPhone = Format(strIn, "@@@.@@@.@@@@")
Case Else
FormatPhone = strIn
End Select

End Function
 

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

Similar Threads

Input masks 1
Input masks 4
Remove input mask format 4
Access - Input Mask 2
Input Mask 1
Phone# Input mask with default 3
Input Mask Default Value 3
Phone Number Input Masks 1

Back
Top