Combining fields in Report Maintain format

  • Thread starter Thread starter srctr
  • Start date Start date
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?
 
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,"@@@-@@@-@@@@")
 
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,"@@@-@@@-@@@@")
 
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.
 
Back
Top