How can I keep an expression from dropping perenthesis in phone number input mask?

I have a report using the following expression:

=IIf([HomePhone] Is Null,"",[HomePhone] & Chr(13) & Chr(10)) & [MobilePhone] & " (cell)" & IIf([SpousePhone] Is Null,"",Chr(13) & Chr(10) & [SpousePhone] & " (" & [SpouseName] & ")")

The expression does what it is supposed to do, except, I am using an input mask for the phone numbers and so the phone number is coming out without any perenthesis and dashes like it should.  For example, the phone number (111) 222-3333 is coming out on the report as 1112223333 and is unacceptable.  I have searched and have been unsuccessful in finding a solution.  Can this be resolved?

Thanks in advance for help!

defixer
defixerAsked:
Who is Participating?
 
ElrondCTConnect With a Mentor Commented:
I don't do much programming in Access. I think my answer about masks is correct for there as well as dBase, but if you need assistance with designing a function to put parentheses and dashes into each phone number, you should post a new question in the Access zone.
0
 
ElrondCTCommented:
If you use a mask, the parentheses and dashes are not actually stored in the database. You need to put them in yourself when you pull the information back out. You may want to set up a function that will do that, but how the function is written depends on what database application you're using. You've posted your question in the dBase zone, but the use of brackets around the field names makes it look like you may be working in Access instead. If you can post what you're working in, I (or someone else) can help you with writing an appropriate function, if you need help.

0
 
defixerAuthor Commented:
Sorry about that.  When I submitted my question I was pretty sure I selected Microsoft Access.  Guess I goofed.  You are right I'm using MS Access 2003.  Thanks for the reply.
0
 
defixerAuthor Commented:
Thank you.  I reposted in the Access Zone and got a fix in just a couple of days.
0
 
defixerAuthor Commented:
I don't know what the policy is, but he got me pointed in the right direction and when I reposted in the Access Zone where I thought I was when I posted this question I quickly got a solution.  I would like to see him awarded the points if possible because he did try and was very courtious and helpful even though he was unable to give me a resolution a resolution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.