different lengths in Masked Edit

Hello:
I want to load data into mask fields...

I have a mask field that's setup to take phone #'s. It needs to be able to take numbers with and without extensions (at most 5 ext. #'s).

It is setup as follows: (###)###-####x#####

The problem, obviously, is that some of the phone #'s don't have an extension or they only have 3 #'s in the ext.
I get an Invalid Property value error when the code attemps to load these #'s.
Is there a way to accept any type of phone #?
Thanx in advance.
Chris.
:confused:
__________________
"There's somone in my head, but it's not me."
[675 byte] By [boonorton] at [2007-11-18 17:35:21]
# 1 Re: different lengths in Masked Edit
Not really the answer to your question, but could you create a seperate text box to contain the extension number?

You could then extract the extension number from the phone number eg extNum = right$(telNum,4).
jp140768 at 2007-11-9 23:19:12 >
# 2 Re: different lengths in Masked Edit
Why not check the length on the change event of the text box and change the mask dynamically.
sargon at 2007-11-9 23:20:13 >
# 3 Re: different lengths in Masked Edit
Excellent idea Sargon, it works perfectly.
Thanks!:thumb:

Chris.
boonorton at 2007-11-9 23:21:17 >