Tables

K

k f h

Hi All,

When creating a table I'm adding a new field called telephone.
If I format it to number it does not except the zero at the begining of the
telephone number. The only way I can do this is to format as text.
Why is this?

Thanks,

kfh.
 
P

Pete

You are better off formatting this field as text. The only reason for
formatting it as a number field is if you wish to perform calculations withe
the data. Clearly this is irrelevant as far as telephone numbers are
concerned!
 
M

Mike Labosh

You are better off formatting this field as text. The only reason for
formatting it as a number field is if you wish to perform calculations
withe
the data. Clearly this is irrelevant as far as telephone numbers are
concerned!

Especially considering the dumb way that data bindings work. If you have a
phone number stored in a numeric column and then type a phone number into a
text box:

555-1212

The hyphen is interpreted as a minus sign, access performs subtraction on
your phone number and what actually gets saved is -657

ditto on ZIP / Postal codes.
--
Peace & happy computing,

Mike Labosh, MCSD

Feed the children!
Save the whales!
Free the mallocs!
 
K

k f h

Hi Pete, Mike,

Thanks,

kfh.


Mike Labosh said:
Especially considering the dumb way that data bindings work. If you have a
phone number stored in a numeric column and then type a phone number into a
text box:

555-1212

The hyphen is interpreted as a minus sign, access performs subtraction on
your phone number and what actually gets saved is -657

ditto on ZIP / Postal codes.
--
Peace & happy computing,

Mike Labosh, MCSD

Feed the children!
Save the whales!
Free the mallocs!
 
B

BBdoll

Hi- I have a similar problem, but my data is already formatted as text. I
want to display the phone number on a report so that it looks like (302)
456-3456 rather than a string of ten numbers. I see no format for this, and
can't implement an input mask since the phone number is already text. HELP!!!
 
D

Dirk Goldgar

BBdoll said:
Hi- I have a similar problem, but my data is already formatted as
text. I want to display the phone number on a report so that it
looks like (302) 456-3456 rather than a string of ten numbers. I see
no format for this, and can't implement an input mask since the phone
number is already text. HELP!!!

Any reason you can't set the format property of the text box on the
report to

(@@@) @@@-@@@@

?
 
B

BBdoll

That is great, but I know it is better off as text, that is why it IS text.
Maybe if I rephrase the question I asked, you could please help me...
I want to display a phone number on a report so that it looks like
(302) 456-3456 rather than 3024563456. Do you know how to do this ?

THANKS!
 
D

Dirk Goldgar

BBdoll said:
That is great, but I know it is better off as text, that is why it IS
text. Maybe if I rephrase the question I asked, you could please help
me...
I want to display a phone number on a report so that it looks like
(302) 456-3456 rather than 3024563456. Do you know how to do this ?

So did you try what I suggested in my earlier post?
 
J

John Vinson

I have a very similar situation and would like to be able to reformat the
number in the actual table. For example if my number looks like 5551234567
how can I update or reformat it to look like 555-123-4567 in the table?
Thanks!

Create a Query based on the table; select the Phone field; and change
the query to an Update query. On the Update To line put

Left([Phone], 3) & "-" & Mid([Phone], 4, 3) & "-" & Right([Phone], 4)

For future entries, set the Input Mask property of the field - or,
better, the form control used to enter the data - to

000-000-0000;0;;

John W. Vinson[MVP]
 
R

rockhound

Thanks John! It worked perfectly.


John Vinson said:
I have a very similar situation and would like to be able to reformat the
number in the actual table. For example if my number looks like 5551234567
how can I update or reformat it to look like 555-123-4567 in the table?
Thanks!

Create a Query based on the table; select the Phone field; and change
the query to an Update query. On the Update To line put

Left([Phone], 3) & "-" & Mid([Phone], 4, 3) & "-" & Right([Phone], 4)

For future entries, set the Input Mask property of the field - or,
better, the form control used to enter the data - to

000-000-0000;0;;

John W. Vinson[MVP]
 
Top