Telephone numbers in fields

W

WoodyAccess

This is my first database and I am learning from scratch and the Microsoft
help options a lot.
I cant figure out how to type telephone numbers starting with 00 in my
telephone field. The data type is set to number but it will only allow
intergers and not a number that starts with 00.
I want the number to start with 00 always but have spaces later in the
number ie 001 859 425 589 but to also allow something like 0044 1584 865985
(for example)
 
K

Kernow Girl

Hi Woody - look up Input Mask in the help files. Here is some of the Help
Text - but there is a lot more and many examples.

You can use the InputMask property to create an input mask (sometimes called
a "field template") that uses literal display characters to control how data
is entered in a field or control. For example, the following input mask
requires that all phone number entries contain exactly enough digits to make
up a U.S. area code and telephone number, and that only numbers can be
entered in each blank. You just fill in the blanks.

An input mask is used in fields (in tables and queries) and in text boxes
and combo boxes (in forms) to format data and provide some control over what
values can be entered. The InputMask property setting consists of literal
characters (such as spaces, dots, dashes, and parentheses) along with special
characters that determine the kind of value that can be entered into the
blank in that position. Input masks are primarily used in Text and Date/Time
fields, but can also be used in Number or Currency fields.

You can set the InputMask property in Design view of a table, query, or
form. In most cases, you'll want to set the property for the field in table
Design view. This way, the input mask is automatically applied to the field
in query Design view and to controls on a form or report bound to that field
(as long as you create the control after setting the property in table Design
view). In certain cases, however, you may want to set the property in query
Design view or form Design view. For example, you might want to omit the
input mask in a table but include it in a text box. Also, if you're using an
unbound control, you'll need to set the InputMask property in form Design
view.

Hope this helps - good luck in learning Access, I have spent the last 3
years at it and have really enjoyed it. Yours - Dika
 
B

BruceM

It needs to be a text field in order to accomodate leading zeros and spaces.
Either that or you need to apply a specific format, but that won't work very
well if you need to enter an international number or some other variant from
the standard pattern.
 
W

WoodyAccess

Thanks for that! Sometimes I think I'm trying to make things more complicated
for myself! It seems simple now that just changing the datatype to text would
allow me to put in letters and numbers!
On I go to encounter some more problems - buts that the way I'll learn it!
 
N

Nick 'The database Guy'

Hi Woody,Bruce,

No matter what this should be stored as a text field.

All numbers should be stored as text fields unless (and granted, it's a
big unless) they are going to added, multipied, subtracted or
manipulated mathematically at any stage.

You would, I feel, never want to add up telephone numbers.

Input masks work well in forms, but you might run in to problems on a
report, furthermore input masks are a nice to have, they do not excuse
people giving their fields the wrong data type. If anyone thinks they
do I'm open to correction.

Woody please don't feel I'm telling you off, its your first database,
we all started somewhere.

Nick
 
N

Nick 'The database Guy'

Hi Woody,Bruce,

No matter what this should be stored as a text field.

All numbers should be stored as text fields unless (and granted, it's a
big unless) they are going to added, multipied, subtracted or
manipulated mathematically at any stage.

You would, I feel, never want to add up telephone numbers.

Input masks work well in forms, but you might run in to problems on a
report, furthermore input masks are a nice to have, they do not excuse
people giving their fields the wrong data type. If anyone thinks they
do I'm open to correction.

Woody please don't feel I'm telling you off, its your first database,
we all started somewhere.

Nick
 
B

BruceM

Actually, I was trying to head off somebody saying "That's not accurate.
You can have leading zeros in a number field by setting the format." I also
said that it wouldn't work very well to use a number field for phone
numbers. I thought it was clear that I recommended using a text field.
 

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

Top