Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Telephone # Input Mask Questions

Status
Not open for further replies.

plantfinder

Technical User
Sep 27, 2002
64
US
I have 3 questions regarding input masks:

1)I want to have a mask that allows entry for phone #s with simple dashes, i.e 222-222-2222. This is not one of the options in the wizard but can someone tell me if this would be correct: !999"- "000\-0000\? The other issue is that I want to have room after that to add an optional extension like: 222-222-2222 ext.2222.I do not want to make that required or show the "ext." as part of the mask. Any help with this would be appreciated.

2)How should I deal with the data that already exists in the table? It is not uniform, as different people have typed in different formats. I don't want it to get all screwed up when I modify the format.

3) Is there and advantage to just using the mask in forms vs tables or vice a versa?

Thanks in advance

Mike
 
!000\-000\-0000;0;_

When you create the input mask, then go to datasheet view, it'll ask you to save the table again. When you do so, it'll change the data already there - if there's no strange phone number combinations.

Input masks on forms override input masks in table definitions.
 
G'day Mike

I'd suggest that you put the ext in a field of its own.

Also, I've found users don't like input masks; they're a nuisance if you use the mouse to click into the field, and happen to click in the middle of the mask.

Instead, I use a bit of code that first checks that there are the required number of digits (10 in your case) after stripping out anything non-numerical, and then formats it correctly. If there aren't 10 digits, you can popup a msgbox showing users the correct format.

Be aware though, that mobile numbers are increasingly being used, which have a diff. number of digits - but this can be handled in the code too.

Max Hugen
Australia
 
I agree with maxhugen, put ext in a field of its' own.

Also, if you want, on the On Enter event of the phone's textobx, you can put:

Private Sub phone_Enter()
Me![phone].SelStart = 0
End Sub

So when the user tabs or clicks into the box, the cursor will be at the far left.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top