|
-
Oct 27th, 2002, 11:57 AM
#1
Thread Starter
Hyperactive Member
How can I format a field
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
-
Oct 27th, 2002, 10:47 PM
#2
Hyperactive Member
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
VB Code:
Text0 = "(" & Left(theNumber, 3) & ")" & Mid(theNumber, 4, 3) & "-" & Mid(theNumber, 7)
You may have to fiddle with the edges but this will work.
To control input do a serch for mask in the help
FW
-
Oct 27th, 2002, 11:25 PM
#3
How about:
VB Code:
MsgBox Format("0123456789", "(000) 000-0000")
will yield: (012) 345-6789
Just note; that a 6 digit number (123456) will become: (000) 012-3456
-
Oct 28th, 2002, 11:50 PM
#4
Thread Starter
Hyperactive Member
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?
-
Oct 29th, 2002, 01:43 PM
#5
Hyperactive Member
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 ..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|