validating a phone number field

  • Follow


I have a phone number field.

I want to make it so that you can only enter the phone number like this:

5278 6356

5221 8596

Etc...

Can anyone help me with this?
0
Reply inzane 10/21/2003 1:14:20 AM

Validated by calculation:

IsEmpty( Phone ) or
( Length( Phone ) = 9 and
Middle( Phone , 5 , 1 ) = " " )

This will verify the 4 space 4 format. You could also add the Trim function
to the Phone field (all three occurrences) if you want the validation to
ignore leading and trailing spaces.

-- 
Shadenfroh


0
Reply Shadenfroh 10/21/2003 2:56:57 PM


"Shadenfroh" <shadenfroh@yahoo.com> wrote in message news:<ZOblb.8656$Uz6.5185@newsread1.news.atl.earthlink.net>...
> Validated by calculation:
> 
> IsEmpty( Phone ) or
> ( Length( Phone ) = 9 and
> Middle( Phone , 5 , 1 ) = " " )
> 
> This will verify the 4 space 4 format. You could also add the Trim function
> to the Phone field (all three occurrences) if you want the validation to
> ignore leading and trailing spaces.

With the method above it says that the field Phone doesnt exist, so i
changed it to the field that i wanted to validate (i.e the field i was
in) and then i got a error msg saying that it would cause a circular
definition.

Can you help?

Regards,
Michael
0
Reply inzane 10/26/2003 11:32:44 PM

I didn't know what you called your "Phone" field, so yes, you would have to
change it to your field name.

It sounds like you may have put the calculation in the Auto-Enter tab,
rather than the validation tab.

-- 
Cain
University of Phoenix
shadenfroh@email.uophx.edu


0
Reply Shadenfroh 10/27/2003 2:36:24 PM

"Shadenfroh" <shadenfroh@yahoo.com> wrote in message news:<I3anb.6065$X22.6000@newsread2.news.atl.earthlink.net>...
> I didn't know what you called your "Phone" field, so yes, you would have to
> change it to your field name.
> 
> It sounds like you may have put the calculation in the Auto-Enter tab,
> rather than the validation tab.

Thanks it seems to be working now. When i put a number in that isnt
the correct vaildation is comes up with a message saying do you want
to accept this value yes or no, which you can click yes and override
it. Is there a way so it doesnt ask that and it can only be put in the
4 space 4 format.

Also if you would be kind enough could you give ma a formula so that i
can do the same with a mobile phone number in this format 0411 333
222.

Regards,
Michael
0
Reply inzane 10/28/2003 3:22:35 AM

in article b681fca9.0310271922.603621b8@posting.google.com, inzane at
inzane@2pac-outlawz.com wrote on 10/27/03 10:22 PM:

> Thanks it seems to be working now. When i put a number in that isnt
> the correct vaildation is comes up with a message saying do you want
> to accept this value yes or no, which you can click yes and override
> it. Is there a way so it doesnt ask that and it can only be put in the
> 4 space 4 format.

Yes, under the Validation tab, you need to check the box that says, "Strict:
do not allow user to override data validation", in addition to having the
"Validate by calculation" box checked.

You also have the option of putting in your own message to be displayed when
an invalid phone number is entered.
 
> Also if you would be kind enough could you give ma a formula so that i
> can do the same with a mobile phone number in this format 0411 333
> 222.

(IsEmpty(phone)) or ((Length(phone)=12) and (Middle(phone, 5, 1) = " ") and
(Middle(phone, 9, 1) = " "))

Good luck.

Ed

0
Reply Edward 10/28/2003 3:58:10 PM

5 Replies
368 Views

(page loaded in 0.074 seconds)

Similiar Articles:











7/24/2012 11:38:36 AM


Reply: