Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2000-05-12
7
143 Views
Last Modified: 2010-05-02
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
Comment
Question by:adharwar
  • 2
  • 2
  • 2
  • +1
7 Comments
 

Expert Comment

by:SpikeDog
ID: 2805583
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
 
LVL 28

Expert Comment

by:AzraSound
ID: 2805585
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
 
LVL 54

Expert Comment

by:nico5038
ID: 2806308
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Accepted Solution

by:
monteh earned 50 total points
ID: 2813119
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
 
LVL 28

Expert Comment

by:AzraSound
ID: 2813176
stop posting answers
0
 

Expert Comment

by:SpikeDog
ID: 2813955
monteh ... are you serious?

Hey Azra ... we gotta stop meeting like this ...
0
 

Expert Comment

by:monteh
ID: 2814271
AzraSound: sorry Answer intended as a Comment. This whole "point" thing is a bit strange to me.

SpikeDog: ?
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question