From: MartyO on
I can not get the right combination to do the following, (maybe it's not
possible). I want to have an input mask for the entire phone number, but I
want the area code to default to our local area code, and if it's different
than that, the user can change it and then type in the rest of the phone
number.
Is that possible?

Thanks!
Marty
From: Arvin Meyer [MVP] on
Instead of an input mask, use the AfterUpdate event to fix the number. Have
the users just enter the digits without any formatting. This function can be
called in the AfterUpdate event:

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 11
FormatPhone = Format(strIn, "@ (@@@) @@@-@@@@")
Case Else
FormatPhone = strIn
End Select

End Function

Set the default value to you local area code and have the cursor start at
the end of the value in the text box (set that in options)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"MartyO" <MartyO(a)discussions.microsoft.com> wrote in message
news:7B064069-9309-4FCA-92B1-8CA18643234F(a)microsoft.com...
>I can not get the right combination to do the following, (maybe it's not
> possible). I want to have an input mask for the entire phone number, but I
> want the area code to default to our local area code, and if it's
> different
> than that, the user can change it and then type in the rest of the phone
> number.
> Is that possible?
>
> Thanks!
> Marty


From: B yousfi on
hoi hoi

"MartyO" <MartyO(a)discussions.microsoft.com> schreef in bericht
news:7B064069-9309-4FCA-92B1-8CA18643234F(a)microsoft.com...
> I can not get the right combination to do the following, (maybe it's not
> possible). I want to have an input mask for the entire phone number, but I
> want the area code to default to our local area code, and if it's
> different
> than that, the user can change it and then type in the rest of the phone
> number.
> Is that possible?
>
> Thanks!
> Marty

From: Tony Toews [MVP] on
MartyO <MartyO(a)discussions.microsoft.com> wrote:

>I can not get the right combination to do the following, (maybe it's not
>possible). I want to have an input mask for the entire phone number, but I
>want the area code to default to our local area code, and if it's different
>than that, the user can change it and then type in the rest of the phone
>number.

You will never, ever have an international phone number that is
outside the USA or Canada?

Also what about phone extensions?

I just give the users a text field.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
Granite Fleet Manager http://www.granitefleet.com/
 | 
Pages: 1
Prev: car
Next: To close database automatically