A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

input mask for phone number



 
 
Thread Tools Display Modes
  #1  
Old February 24th, 2009, 07:35 AM posted to microsoft.public.access.gettingstarted
Steve2788
external usenet poster
 
Posts: 5
Default input mask for phone number

I am making an input mask for a phone number. sometimes i don't want to
include an area code. the information on help says:

Examples of input masks
The examples in the following table demonstrate some ways that you can use
input masks.

This input mask Provides this type of value Notes
(000) 000-0000 (206) 555-0199 In this case, you must must enter an area code
because that section of the mask (000, enclosed in parentheses) uses the 0
placeholder.
(999) 000-0000! (206) 555-0199
( ) 555-0199 In this case, the area code section uses the 9 placeholder, so
area codes are optional. Also, the exclamation point (!) causes the mask to
fill in from left to right.

However when i try it with or without the !, the field fills in from the
left. Unless I type [space],[space],[space], then the 7-digit number it will
not accept it.
  #2  
Old February 24th, 2009, 06:58 PM posted to microsoft.public.access.gettingstarted
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default input mask for phone number

I don't use input masks for phone numbers or zip codes. Why? If you ever have
to do business with someone out of the USA or Canada, the phone number won't
fit. For zipcodes it's even worse as Canada, and the rest of the world, have
a much different postal code addressing system.

If it's causing you grief, you might consider just not doing an input mask.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"Steve2788" wrote:

I am making an input mask for a phone number. sometimes i don't want to
include an area code. the information on help says:

Examples of input masks
The examples in the following table demonstrate some ways that you can use
input masks.

This input mask Provides this type of value Notes
(000) 000-0000 (206) 555-0199 In this case, you must must enter an area code
because that section of the mask (000, enclosed in parentheses) uses the 0
placeholder.
(999) 000-0000! (206) 555-0199
( ) 555-0199 In this case, the area code section uses the 9 placeholder, so
area codes are optional. Also, the exclamation point (!) causes the mask to
fill in from left to right.

However when i try it with or without the !, the field fills in from the
left. Unless I type [space],[space],[space], then the 7-digit number it will
not accept it.

  #3  
Old February 24th, 2009, 07:35 PM posted to microsoft.public.access.gettingstarted
Gina Whipp
external usenet poster
 
Posts: 3,500
Default input mask for phone number

Steve,

As Jerry says, input masks are not a good idea unless you plan on sticking
with the US only. If you are trying to 'force' consistent data entry you
might want to consider writing some validation code.

Untested...
If [ZipCode] = DLookUp("ZipCode",'TableWithUSZipCodes","ZipCode ='" &
Me![ZipCode] & "'") Then
Me.YourZipCodeField = Me.YourZipCodeField.InputMask = "00000-9999"
End If

Not an easy thing to do with phone numbers but perhaps you could 'force' an
input mask based on whether the zip is US or not.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Jerry Whittle" wrote in message
...
I don't use input masks for phone numbers or zip codes. Why? If you ever
have
to do business with someone out of the USA or Canada, the phone number
won't
fit. For zipcodes it's even worse as Canada, and the rest of the world,
have
a much different postal code addressing system.

If it's causing you grief, you might consider just not doing an input
mask.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"Steve2788" wrote:

I am making an input mask for a phone number. sometimes i don't want to
include an area code. the information on help says:

Examples of input masks
The examples in the following table demonstrate some ways that you can
use
input masks.

This input mask Provides this type of value Notes
(000) 000-0000 (206) 555-0199 In this case, you must must enter an area
code
because that section of the mask (000, enclosed in parentheses) uses the
0
placeholder.
(999) 000-0000! (206) 555-0199
( ) 555-0199 In this case, the area code section uses the 9 placeholder,
so
area codes are optional. Also, the exclamation point (!) causes the mask
to
fill in from left to right.

However when i try it with or without the !, the field fills in from the
left. Unless I type [space],[space],[space], then the 7-digit number it
will
not accept it.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.