Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Phone Numbers Properly

Status
Not open for further replies.

Maquis

Programmer
Jul 19, 2001
934
US
I'm hoping this is a simple problem for someone.

I'm trying to display a phone number on my report. The number is stored in a table with no formatting at all, just numbers. I've applied an input mask to my report in order to display the phones correctly, but it isn't working quite right.

If a 10 digit number is stored my report shows the number correctly - (757)555-1212, but if a 7 digit number is stored without the area code then the mask just displays the raw number without the dash, 5551212.

Here is the input mask I'm currently using, !(999) 000-0000;;_

Any ideas? Maq [americanflag]
<insert witty signature here>
 
maquis,
Try changing the format to
&quot;(999)&quot;000-0000&quot;;

Works for me...
jim
 
Nope, didn't work. That took all the formatting off. Maq [americanflag]
<insert witty signature here>
 
Accck! I got it figured out. My mistake, the input mask does work properly. Turns out the data is bad. All the phone numbers that didn't display properly had a ton of spaces stored at the end of the fields.

AArrrrghhh, I wish I could control the data entry system, but unfortunately that's a system that's out of my control. I've spent the last 4 months adding Trim() functions to almost every form/report/query in this database. Looks like there's one more to add to the list. Maq [americanflag]
<insert witty signature here>
 
maquis, glad you found the problem, yes data entry is definately one of the biggest headaches around..
jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top