A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Phone Number Validation/Input Mask



 
 
Thread Tools Display Modes
  #1  
Old March 12th, 2005, 06:35 PM
DianeandChipps
external usenet poster
 
Posts: n/a
Default Phone Number Validation/Input Mask

Please can someone help!!
I have a database for room bookings and I need to enter a clients phone
number. The format for the phone number could be either 01234 123456 or 0123
123 1234.
Is there any way, depending on whether there are 12 or 13 characters
including spaces, that the phone number can be formatted so the user would
type the numbers without spaces? This is my first database so simple help
would be appreciated, many thanks.
  #2  
Old March 14th, 2005, 01:51 PM
Marsela
external usenet poster
 
Posts: n/a
Default

Hi Diane!

Copy this format in Input Mask: !00000\ 000000;0;_
Thanks
Marsela
MOS-MCP

-----Original Message-----
Please can someone help!!
I have a database for room bookings and I need to enter a

clients phone
number. The format for the phone number could be either

01234 123456 or 0123
123 1234.
Is there any way, depending on whether there are 12 or 13

characters
including spaces, that the phone number can be formatted

so the user would
type the numbers without spaces? This is my first

database so simple help
would be appreciated, many thanks.
.

  #3  
Old March 14th, 2005, 02:41 PM
DianeandChipps
external usenet poster
 
Posts: n/a
Default

Many thanks Marsela, but this only gives me one option. I know the format
for each of them but what I need to have is an option. For example: If the
phone number has 12 numbers in it then it will format as you suggested, but,
if the phone number has 13 numbers in it then it would format as !0000\ 000\
0000;0;_
Is there a way that the input mask could decide which format to choose
depending on how many numbers are typed?

"Marsela" wrote:

Hi Diane!

Copy this format in Input Mask: !00000\ 000000;0;_
Thanks
Marsela
MOS-MCP

-----Original Message-----
Please can someone help!!
I have a database for room bookings and I need to enter a

clients phone
number. The format for the phone number could be either

01234 123456 or 0123
123 1234.
Is there any way, depending on whether there are 12 or 13

characters
including spaces, that the phone number can be formatted

so the user would
type the numbers without spaces? This is my first

database so simple help
would be appreciated, many thanks.
.


  #4  
Old March 14th, 2005, 06:31 PM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Mon, 14 Mar 2005 06:41:05 -0800, "DianeandChipps"
wrote:

Is there a way that the input mask could decide which format to choose
depending on how many numbers are typed?


No. The mask property is really pretty limited.

YOu'll need to use VBA code in the BeforeUpdate event of the control
to check the formatting.

John W. Vinson[MVP]
  #5  
Old March 14th, 2005, 07:17 PM
DianeandChipps
external usenet poster
 
Posts: n/a
Default

Many thanks John, would this be hard to do? I am not sure where to start!!
Diane

"John Vinson" wrote:

On Mon, 14 Mar 2005 06:41:05 -0800, "DianeandChipps"
wrote:

Is there a way that the input mask could decide which format to choose
depending on how many numbers are typed?


No. The mask property is really pretty limited.

YOu'll need to use VBA code in the BeforeUpdate event of the control
to check the formatting.

John W. Vinson[MVP]

  #6  
Old March 16th, 2005, 04:48 PM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

It's not clear how the programming knows the difference between this
11-character number:
01234123456
which you want to be formatted as
01234 123456

and this number:
01231231234
which you want to be formatted as
0123 123 1234

If the user is to be allowed to type the numbers without spaces, then what
determines whether the resulting number string should have one or two
spaces?
--

Ken Snell
MS ACCESS MVP





"DianeandChipps" wrote in message
...
Many thanks John, would this be hard to do? I am not sure where to
start!!
Diane

"John Vinson" wrote:

On Mon, 14 Mar 2005 06:41:05 -0800, "DianeandChipps"
wrote:

Is there a way that the input mask could decide which format to choose
depending on how many numbers are typed?


No. The mask property is really pretty limited.

YOu'll need to use VBA code in the BeforeUpdate event of the control
to check the formatting.

John W. Vinson[MVP]



  #7  
Old March 17th, 2005, 02:25 PM
DianeandChipps
external usenet poster
 
Posts: n/a
Default

Ken

I see your point, think I got a bit muddled, I was counting the spaces as
charachters without realising that there was the same amount of numbers!!
Is it possible that if the user keys in the spaces then it would be
formatted as (01234) 123456 or (0123) 123 1234?

Many thanks
Diane

"Ken Snell [MVP]" wrote:

It's not clear how the programming knows the difference between this
11-character number:
01234123456
which you want to be formatted as
01234 123456

and this number:
01231231234
which you want to be formatted as
0123 123 1234

If the user is to be allowed to type the numbers without spaces, then what
determines whether the resulting number string should have one or two
spaces?
--

Ken Snell
MS ACCESS MVP





"DianeandChipps" wrote in message
...
Many thanks John, would this be hard to do? I am not sure where to
start!!
Diane

"John Vinson" wrote:

On Mon, 14 Mar 2005 06:41:05 -0800, "DianeandChipps"
wrote:

Is there a way that the input mask could decide which format to choose
depending on how many numbers are typed?

No. The mask property is really pretty limited.

YOu'll need to use VBA code in the BeforeUpdate event of the control
to check the formatting.

John W. Vinson[MVP]




  #8  
Old March 17th, 2005, 03:24 PM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

Is it that you want the numbers displayed with the appropriate "format", or
do you want them saved into the table with that "format"?

And is the "format" now just whether the first four or the first five
numbers go inside parentheses?
--

Ken Snell
MS ACCESS MVP


"DianeandChipps" wrote in message
...
Ken

I see your point, think I got a bit muddled, I was counting the spaces as
charachters without realising that there was the same amount of numbers!!
Is it possible that if the user keys in the spaces then it would be
formatted as (01234) 123456 or (0123) 123 1234?

Many thanks
Diane

"Ken Snell [MVP]" wrote:

It's not clear how the programming knows the difference between this
11-character number:
01234123456
which you want to be formatted as
01234 123456

and this number:
01231231234
which you want to be formatted as
0123 123 1234

If the user is to be allowed to type the numbers without spaces, then
what
determines whether the resulting number string should have one or two
spaces?
--

Ken Snell
MS ACCESS MVP





"DianeandChipps" wrote in
message
...
Many thanks John, would this be hard to do? I am not sure where to
start!!
Diane

"John Vinson" wrote:

On Mon, 14 Mar 2005 06:41:05 -0800, "DianeandChipps"
wrote:

Is there a way that the input mask could decide which format to
choose
depending on how many numbers are typed?

No. The mask property is really pretty limited.

YOu'll need to use VBA code in the BeforeUpdate event of the control
to check the formatting.

John W. Vinson[MVP]






  #9  
Old March 18th, 2005, 07:01 AM
DianeandChipps
external usenet poster
 
Posts: n/a
Default

oen, thanks for you patience.
The details would be entered through the form, does the format need to be on
the table as well-maybe for consistency it would be better to format the
table as well. You are correct the "format" is now whether the first four or
the first five numbers go inside parentheses.
Diane


"Ken Snell [MVP]" wrote:

Is it that you want the numbers displayed with the appropriate "format", or
do you want them saved into the table with that "format"?

And is the "format" now just whether the first four or the first five
numbers go inside parentheses?
--

Ken Snell
MS ACCESS MVP


"DianeandChipps" wrote in message
...
Ken

I see your point, think I got a bit muddled, I was counting the spaces as
charachters without realising that there was the same amount of numbers!!
Is it possible that if the user keys in the spaces then it would be
formatted as (01234) 123456 or (0123) 123 1234?

Many thanks
Diane

"Ken Snell [MVP]" wrote:

It's not clear how the programming knows the difference between this
11-character number:
01234123456
which you want to be formatted as
01234 123456

and this number:
01231231234
which you want to be formatted as
0123 123 1234

If the user is to be allowed to type the numbers without spaces, then
what
determines whether the resulting number string should have one or two
spaces?
--

Ken Snell
MS ACCESS MVP





"DianeandChipps" wrote in
message
...
Many thanks John, would this be hard to do? I am not sure where to
start!!
Diane

"John Vinson" wrote:

On Mon, 14 Mar 2005 06:41:05 -0800, "DianeandChipps"
wrote:

Is there a way that the input mask could decide which format to
choose
depending on how many numbers are typed?

No. The mask property is really pretty limited.

YOu'll need to use VBA code in the BeforeUpdate event of the control
to check the formatting.

John W. Vinson[MVP]







  #10  
Old March 18th, 2005, 02:18 PM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

OK - let's go for the moment with formatting the numbers and storing them
that way.

Assuming that the person will enter the phone number with appropriate spaces
(e.g., 01234 123456 or 0123 123 1234), and assuming that you'll want
( ) characters around the first number block (up to the first space), you
could use this generic code on the textbox's AfterUpdate event to do the
formatting:

Private Sub TextBoxName_AfterUpdate()
Me.TextBoxName.Value = "(" & Left(Me.TextBoxName.Value, _
InStr(Me.TextBoxName.Value, " ") - 1) & ")" & _
Mid(Me.TextBoxName.Value, InStr(Me.TextBoxName.Value, " "))
End Sub

--

Ken Snell
MS ACCESS MVP


"DianeandChipps" wrote in message
...
oen, thanks for you patience.
The details would be entered through the form, does the format need to be
on
the table as well-maybe for consistency it would be better to format the
table as well. You are correct the "format" is now whether the first four
or
the first five numbers go inside parentheses.
Diane


"Ken Snell [MVP]" wrote:

Is it that you want the numbers displayed with the appropriate "format",
or
do you want them saved into the table with that "format"?

And is the "format" now just whether the first four or the first five
numbers go inside parentheses?
--

Ken Snell
MS ACCESS MVP


"DianeandChipps" wrote in
message
...
Ken

I see your point, think I got a bit muddled, I was counting the spaces
as
charachters without realising that there was the same amount of
numbers!!
Is it possible that if the user keys in the spaces then it would be
formatted as (01234) 123456 or (0123) 123 1234?

Many thanks
Diane

"Ken Snell [MVP]" wrote:

It's not clear how the programming knows the difference between this
11-character number:
01234123456
which you want to be formatted as
01234 123456

and this number:
01231231234
which you want to be formatted as
0123 123 1234

If the user is to be allowed to type the numbers without spaces, then
what
determines whether the resulting number string should have one or two
spaces?
--

Ken Snell
MS ACCESS MVP





"DianeandChipps" wrote in
message
...
Many thanks John, would this be hard to do? I am not sure where to
start!!
Diane

"John Vinson" wrote:

On Mon, 14 Mar 2005 06:41:05 -0800, "DianeandChipps"
wrote:

Is there a way that the input mask could decide which format to
choose
depending on how many numbers are typed?

No. The mask property is really pretty limited.

YOu'll need to use VBA code in the BeforeUpdate event of the
control
to check the formatting.

John W. Vinson[MVP]









 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Name and phone number in calendar "caption" Rimdur Contacts 1 February 1st, 2005 09:47 PM
Can't find "Social Security Number" data in Input Mask Wizard Wind azik Database Design 1 January 1st, 2005 07:31 PM
home phone number wca123 General Discussion 5 November 18th, 2004 03:29 PM


All times are GMT +1. The time now is 05:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.