My database is in Access and I need to format a field like this
HomePhone = " (###) ###-####
because the field print just like this whithout format
9999999999
How can I format this field and were, please
Thank in advance
Printable View
My database is in Access and I need to format a field like this
HomePhone = " (###) ###-####
because the field print just like this whithout format
9999999999
How can I format this field and were, please
Thank in advance
I assume you want to display this on a form.
There is an easier way but I can't find it.
Here's a work around
You may have to fiddle with the edges but this will work.VB Code:
Text0 = "(" & Left(theNumber, 3) & ")" & Mid(theNumber, 4, 3) & "-" & Mid(theNumber, 7)
To control input do a serch for mask in the help
FW
How about:
will yield: (012) 345-6789VB Code:
MsgBox Format("0123456789", "(000) 000-0000")
Just note; that a 6 digit number (123456) will become: (000) 012-3456
Thank you for your response
The two example are correct and these work only on a form but, what about a report? I want to display on the report these fields. I can not find a way how to use it. I dont know if I have to use a formula?
u can use a formula to do that..left , mid and right functions are availble in crystal rep also..
if the field is a number .. then first use 'totext' function to convert the number to text ..