Solved

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

Posted on 2000-05-12
7
140 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library 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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now