dashes in phone nos

J

Joanne

I am automating word from access, office 2000 winxp

My access table contains 2 phone numbers and a social security number
(500) 222-2222, (500) 333-3333, 444-44-4444

I am storing these values in the tables with the dashes and
parantheses in place, but when I use the value and set it in a
bookmark in an msword doc, the dashes and parens are not displayed.

How can I remedy this, please?

Thank you
Joanne
 
D

Doug Robbins

If the Access fields are numeric fields, then the data is not actually being
stored in that format.

To get that format in Word, you will need to use the Format() function.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
M

Malcolm Smith

Joanne

Be aware that one day you may have to deal with a company overseas or
with someone with a foreign social security number.

I would advise against assuming that this will always be the case because,
sooner or later, the Real World will come and bite.

- Malc
 
J

Joanne

Doug
Thanks for the information
I tried setting the format in the query which the table is built on
This is what I tried:
Phone: Format("000\-000\-0000;);_")
When I run the query, the field is now missing from the results!
So I tried this Phone:("000-000-0000")
Same results

SO I went to the form, and on the control properties, I tried to set
the format property to ("000\-000\-0000;);_") but it won't accept it.

I looked in ms word, thinking that I could format the bookmark itself
to put the dashes in, but I couldn't find anything there.

In the design of the table, the phone and ssn numbers are 'text' type
fields, and I set the input mask there to produce the results with the
dashes. They show up fine in the table and in the query, dashes and
all. I just can't get it to show up in the word doc bookmark.

Can you point me in the right direction please?
Thanks for your time
Joanne
 
D

Doug Robbins

I assume that Phone is the name of the field in the table. If that is the
case, you would need to use

PhoneNum:Format([Phone], "000-000-0000")

I always find that it is better to give the expression a name that is
different from the names of the fields in the table(s) upon which the query
is based.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
J

Joanne

Doug
Thank you for your reply
Yes, Phone is the name of the field in my table.
So would I put your formatting statement in the query on the phone
field, or would I be adding a field to the query named PhoneNum and
adding the format syntax you provided?

I'm still not sure where to put the formatting to cause the desired
result.
 
D

Doug Robbins

You can start with the Phone field and modify the entry in the query so that
it is the same as my example, or you can just type it in there directly.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
Joanne said:
Doug
Thank you for your reply
Yes, Phone is the name of the field in my table.
So would I put your formatting statement in the query on the phone
field, or would I be adding a field to the query named PhoneNum and
adding the format syntax you provided?

I'm still not sure where to put the formatting to cause the desired
result.
Doug said:
I assume that Phone is the name of the field in the table. If that is the
case, you would need to use

PhoneNum:Format([Phone], "000-000-0000")

I always find that it is better to give the expression a name that is
different from the names of the fields in the table(s) upon which the
query
is based.
 
D

Doug Robbins

Or copy and paste it into the grid.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
Joanne said:
Doug
Thank you for your reply
Yes, Phone is the name of the field in my table.
So would I put your formatting statement in the query on the phone
field, or would I be adding a field to the query named PhoneNum and
adding the format syntax you provided?

I'm still not sure where to put the formatting to cause the desired
result.
Doug said:
I assume that Phone is the name of the field in the table. If that is the
case, you would need to use

PhoneNum:Format([Phone], "000-000-0000")

I always find that it is better to give the expression a name that is
different from the names of the fields in the table(s) upon which the
query
is based.
 

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