Solved

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

Posted on 2000-05-12
7
144 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
[X]
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
  • 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
Industry Leaders: 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!

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 Compile Compatibility Issue 4 122
How to debug this code 7 65
vb6 connector to mongodb 2 141
transition to visual .net from vb6 5 62
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

733 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