Combining fields in Report Maintain format

S

srctr

I am combining 2 phone numbers into one field on a report.
=[HomePhone] & Chr(13)+Chr(10)+[MobilePhone]
This works but the second number loses its format and it show like this
800-555-1212
8005551212

How do I fix?
 
M

Marshall Barton

srctr said:
I am combining 2 phone numbers into one field on a report.
=[HomePhone] & Chr(13)+Chr(10)+[MobilePhone]
This works but the second number loses its format and it show like this
800-555-1212
8005551212


It should lose the format for the first number too. Try
using an expression like:

=Format(HomePhone,"@@@-@@@-@@@@") &
Chr(13)+Chr(10)+Format(MobilePhone,"@@@-@@@-@@@@")
 
S

srctr

When I put the format in for both it made the first number have an extra
hyphen. Don't know why the format is there for the first number and not the
second. I do have an Input mask set for this field.

But when I put the format you suggested for just the MobilePhone both
numbers look correct now. Thanks

Marshall Barton said:
srctr said:
I am combining 2 phone numbers into one field on a report.
=[HomePhone] & Chr(13)+Chr(10)+[MobilePhone]
This works but the second number loses its format and it show like this
800-555-1212
8005551212


It should lose the format for the first number too. Try
using an expression like:

=Format(HomePhone,"@@@-@@@-@@@@") &
Chr(13)+Chr(10)+Format(MobilePhone,"@@@-@@@-@@@@")
 
M

Marshall Barton

Input masks can be a pain and I won't use them. Check all
the details of how you have the mask set up for the two
fields. Look for something different especially the C code
and the second section.
 

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