Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 18th, 2004, 11:24 PM
bph bph is offline
Friend of Wrox
 
Join Date: Dec 2003
Location: , , .
Posts: 102
Thanks: 2
Thanked 0 Times in 0 Posts
Default U.S versus International Phone Numbers

How do people deal with this seemingly common issue, considering our global economy, using only one textbox?

Can't format or input mask for both types of phone numbers.

Am I looking at invisible textboxes again?

Somehow reinventing the wheel doesn't seem necessary.

thx, bph
Reply With Quote
  #2 (permalink)  
Old February 19th, 2004, 08:37 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

If a US and Canadian number has ten digits and other international phone numbers have more then store JUST the number in the table WITHOUT the formatting (it saves space, btw). However, on the form and reports' On Current events, format the textboxes on the fly to fit the number based on the country.

In other words, STORE just numbers but SHOW proper formats based on country.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #3 (permalink)  
Old February 19th, 2004, 09:44 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: Houston, Texas, USA.
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

go to http://www.rogersaccesslibrary.com/OtherLibraries.asp and then click on Tejpal, A.D. He has a sample database called InputMask_Dynamic.mdb with the following description:
This sample db demonstrates dynamic setting of Input Masks at run time - with
partly pre-filled values as desired.
Three cases are covered -
        (a) Phone Numbers - with area codes pre-filled
        (b) Dates pre-filled with desired month and year part.
        (c) Text string prefixed/suffixed with current month-year.
The sample is in Access 2000 file format developed on Access XP installation.

HTH,

Beth M
Reply With Quote
  #4 (permalink)  
Old February 19th, 2004, 03:05 PM
bph bph is offline
Friend of Wrox
 
Join Date: Dec 2003
Location: , , .
Posts: 102
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks to you both. Plenty of good info to work with.

Reply With Quote
  #5 (permalink)  
Old February 19th, 2004, 05:00 PM
bph bph is offline
Friend of Wrox
 
Join Date: Dec 2003
Location: , , .
Posts: 102
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Okay, so I thought I had come up with a simple way to solve this issue. And I think I'm on the right track.
I created a unbound checkbox called chk_USA on the form next to the phone number text box.
In the ONCURRENT Event if have the ollowing code.

If Me.Chk_USA.Value = True Then
Me.txtContactPerson_Phone_Number_1.InputMask = "999\-000\-0000;0;_"
Else: Me.txtContactPerson_Phone_Number_1.InputMask = "#########################"

My theory is that if the box is checked then "999\....format for entry in the txtbox. Else enter whatever the foreign number is. Somehow the code doesn't pick up the checked box and give me the "999\...format. Always get the else format__________________ ? What am I missing -- thx, bph
Reply With Quote
  #6 (permalink)  
Old February 19th, 2004, 05:03 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Change that to just

If Me.Chk_USA Then

Because Me.Chk_USA is a checkbox that holds a boolean value (True/False), you don't need to quantify it for the IF statement.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #7 (permalink)  
Old February 19th, 2004, 05:15 PM
bph bph is offline
Friend of Wrox
 
Join Date: Dec 2003
Location: , , .
Posts: 102
Thanks: 2
Thanked 0 Times in 0 Posts
Default

I put the code in the control on the form and it's working.

This format {InputMask = "999\-000\-0000;0;_"} allows for the entry of a typical phone number, say 456-123-7890. What needs to be added to the mask to allow for an extension to be typed into the same field right after the phone number?

Thanks....bph
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular expression for phone numbers [both U.S. an kamii47 BOOK: Beginning Regular Expressions 0 September 8th, 2007 03:08 AM
Removing Blank Spaces in Phone Numbers Brendan Bartley Access 1 April 12th, 2007 11:42 AM
trying to make a custom label for phone numbers... thenoseknows ASP.NET 2.0 Professional 2 August 22nd, 2006 06:07 PM
formatting phone numbers xslt_student XSLT 0 August 7th, 2006 04:10 PM
International Text Chris Beach C# 2 May 24th, 2004 01:47 AM



All times are GMT -4. The time now is 04:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.