Leading "0" in Phone Area Code

aussie

Registered User.
Local time
Tomorrow, 02:05
Joined
May 27, 2012
Messages
47
Hi,
I can't set a leading 0 in my telephone area code. Access automatically resets the area code to a single digit (eg 08 is reset to 8).
Can anyone give me a hand?
 
With your table in design view set the Format to 00. This assumes that you are saving the area code in it's own field and that it will only ever be a double digit.
 
I guess it is a number field, may be you can make it a text field since
you won't need to use it for calculations. Then a leading 0 will be
no problem.

Catalina
 
The Format Field is set to "00". It is a text field. I changed it to a Number field, but still got the same result - no leading zero.
 
Once you change it to a text field, you need to update the existing values. Once you do this, they will stay. Use the Format() function
Format(yourfield, "00")
use as many zeros as you need for a fixed length. This will change single digits to double. Three zeros would change 1 to 001 or 21 to 021 but leave 321 alone.
 
Also, setting your format to text allows you to input certain symbols eg hyphens, if you local directory displays number groupings seperated by such symbols eg 555-5555. Also, you can then add in such anomalies as Ext.123 if you are recording department Nos. within large companies. A number format won't allow non-numerical data.

If you want to include International dialling code facilities, the current standard format (based on calls made from Mobiles/Cell phones) is to precede the Number with a +symbol followed by the digit(s) required to call INTO that Country. Eg for UK based numbers it's +44, for Australia it's +61 and USA it's +1. The leading '0' is then placed in parenthesis ie (0). It is only required if making a local or National call, but dropped if making an International call. My number begins +61 (0) 406. A call made to my Aussie phone from another Aussie phone would begin 0406... but if made from a foreign phone +61 406...

You may wish to format your field to record International Dialling.
 
The ability to insert other characters in a text field is one reason I prefer to use numbers. Allowing data entry with other characters inevitably ends up with a multitude of different patterns depending on who enters it.

Use separate field for IntCode, AreaCode, Phone and Ext. Long is big enough to hold nine digits and takes less space to store than the same as text.

The system can have full control over the number structure allowing them to be logically concatenated if you want to use a modem to dial automatically. Allow all that other stuff in there and it has to be parsed and stripped which will inevitably be complex and result in reliability problems.

It is faster to search the for a phone number in a numeric field. Indexing on a number is also faster. A partial search (eg last four digits) is also faster with the numeric calculation than the text.

A consistent format can be applied to the display of the number right across the system.
eg
Format([field],"#### ####")
 
Thanks - you set me on the right path. I needed to enclose the Default field in "".
 

Users who are viewing this thread

Back
Top Bottom