Solved

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

Posted on 2000-05-12
7
142 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

772 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