Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 150
  • Last Modified:

Easy method of Formatting Phone fields in Forms and Reports??

Is there way of formatting the (text)fields in the forms, grids and reports.
I tried the Custom format without much success. If there is a way without using mask edits I would be glad.
0
adharwar
Asked:
adharwar
  • 2
  • 2
  • 2
  • +1
1 Solution
 
SpikeDogCommented:
If you want just to display the values you could do something like:

Text1.text = format(strText,"(##) ### ####")

That would give a basic phone number format.

0
 
AzraSoundCommented:
for a phone number, if you were entering it into a textbox for example, then, say you let the user just enter the ten digits straight...after submitting the number via a command button or clicking enter you can format that text the way you want to...for example:

Private Sub cmdSubmit_Click()
    Text1.Text = Format(Text1.Text, "(###)###-####")
End Sub

0
 
nico5038Commented:
I stopped formatting phonenumbers when I found out that there were too many formats around when one wants to use not only local but also international numbers.
Just give the user the freedom to insert it the way he wants !
In a freeformat text field he could even add an extension number if he would like to do so. Just make the textfield large enough.

Nico
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
montehCommented:
There's a function on my website. The function can be generic, but the mask, if any, has to be locale driven. This would usually be driven by the address record. Here's some code:

http://www.killervb.com/code/commonbas/inputvalidation.htm#ValidTelFormat
0
 
AzraSoundCommented:
stop posting answers
0
 
SpikeDogCommented:
monteh ... are you serious?

Hey Azra ... we gotta stop meeting like this ...
0
 
montehCommented:
AzraSound: sorry Answer intended as a Comment. This whole "point" thing is a bit strange to me.

SpikeDog: ?
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now