Input Mask prob - Telephone pattern

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a telephone field in my table. I'd like to restrict the pattern of
entry to be something like (0?)??? ????

So I have this in the Input Mask as suggested by F1 help:
"(0"0") "000\-0000;0;?

But this would only display the number as say 91234567 in View, rather than
(09)123 4567 as I intended - i.e. both Brackets ans Space aren't shown!

What would be the work around for this? Many thanks for your time and help
 
Sam said:
I have a telephone field in my table. I'd like to restrict the
pattern of entry to be something like (0?)??? ????

So I have this in the Input Mask as suggested by F1 help:
"(0"0") "000\-0000;0;?

But this would only display the number as say 91234567 in View,
rather than (09)123 4567 as I intended - i.e. both Brackets ans Space
aren't shown!

What would be the work around for this? Many thanks for your time and
help

I hate input masks and would suggest a @@@ @@@-@@@@ format instead.

This way a local number shows properly and you can still toss in an area
code.

If you do use the Input mask teach your users to click on the label instead
of inside the field. This will always put the cursor in the right spot.
 
thanks Mike. I will take on your suggestion because I find the Input Mask
somewhat annoying too. But the 1st digit of area code being 0 (in New
Zealand) still doesn't display in View. What can I do about it?? Thanks
 
Please igonre my last post. I noted that its just a matter of putting a slash
(\) before 0 to make it a literal character.
 
Mmm..now here's another problem :(
Because some cellphone number is 6 digit long while others are 7 digits.
i.e. 021 123 456 or 021 123 4567
Could this be catered for using Formate? or would I have to go for Input Mask?

With input mask, however, typed charaters are aligned to the right, unlike
F1 Help's explaination that "Characters typed into the mask always fill it
from left to right"
i.e. input mask= \000\ 000\ 0009
typing 021 123 456 would dispaly as 0 2 112 3456

I have tried with and without the exclamation mark (!) but it still doesn't
work.
What can I do?
 
Sam said:
Mmm..now here's another problem :(
Because some cellphone number is 6 digit long while others are 7
digits.
i.e. 021 123 456 or 021 123 4567
Could this be catered for using Formate? or would I have to go for
Input Mask?

With input mask, however, typed charaters are aligned to the right,
unlike
F1 Help's explaination that "Characters typed into the mask always
fill it from left to right"
i.e. input mask= \000\ 000\ 0009
typing 021 123 456 would dispaly as 0 2 112 3456
I'm guessing you are using a number instead of text for the field. Phone
numbers should be text. This solves the zero problem and lets you enter
those darned spelled out numbers.

This AfterUpdate code will format and store text numbers properly but does
not have any error checking.

If Len(Me!YourFieldname) = 10 Then
Me!YourFieldname = Format(Me!YourFieldname, "@@@ @@@ @@@@")
Else ' assume 9 digits
Me!YourFieldname = Format(Me!YourFieldname, "@@@ @@@ @@@")
End If

With a Select statement it could be expanded to automatically add 021 if the
length was 6 or 7, ignore empty fields and throw an error message if there
were the wrong number of digits.
 
This is brilliant! Much appreciated. Thanks Mike.
Hope your question is answered shortly, too
 
Back
Top