By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,207 Members | 1,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,207 IT Pros & Developers. It's quick & easy.

Access 97 - Input Mask

P: n/a
Hi everyone, here is the problem:

I have 2 fields...Province and PostalCode
The afterUpdate event of the province has this snippet of code:
...
...
If Country = "canada" Then PostalCode.InputMask = ">L0L\ 0L0;0;_"
docmd.gotocontrol "PostalCode"
...
...
NOTE: I can't put the input make in the table or on the fields property for
various reasons by choice. I need it to work as below.

The cursor moves as expected, but when I get to the Postal Code field, I can
type anything I want. Not until I try to leave the field does the input
mask tell me that my syntax is wrong that I did not type the correct Postald
Code. What it should be doing is restricting the entery as I type it, like
a normal input mask is designed to do.

I used an Immediate window to see what the ? postalcode was, and it showed
me the correct code.
So why is this not working, and better yet. How do I get it to work.

Thanks in advance
Paul
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Since the user can enter any control on the form at will, having the
AfterUpdate event of one control change the InputMask of another control
is problematical. It would probably be a better idea to use the
BeforeUpdate event of the Postal Code control to determine if the code
is in the correct format, depending on the Country value. If the format
is incorrect set Cancel = True & display the error message.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQcMq94echKqOuFEgEQK64gCgpDramt0hk2RA1FCZLOU1Gc N0H1UAn2Jz
ItY8GSqunyKcbX3xg5huiy8f
=Lqdq
-----END PGP SIGNATURE-----
Paul wrote:
Hi everyone, here is the problem:

I have 2 fields...Province and PostalCode
The afterUpdate event of the province has this snippet of code:
...
...
If Country = "canada" Then PostalCode.InputMask = ">L0L\ 0L0;0;_"
docmd.gotocontrol "PostalCode"
...
...
NOTE: I can't put the input make in the table or on the fields property for
various reasons by choice. I need it to work as below.

The cursor moves as expected, but when I get to the Postal Code field, I can
type anything I want. Not until I try to leave the field does the input
mask tell me that my syntax is wrong that I did not type the correct Postald
Code. What it should be doing is restricting the entery as I type it, like
a normal input mask is designed to do.

I used an Immediate window to see what the ? postalcode was, and it showed
me the correct code.
So why is this not working, and better yet. How do I get it to work.

Nov 13 '05 #2

P: n/a
Thanks, but that won't work since the country is entered after the Postal
Code.

I have managed to do a workaround to get what I wanted.

Thanks
"MGFoster" <me@privacy.com> wrote in message
news:aX*****************@newsread1.news.pas.earthl ink.net...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Since the user can enter any control on the form at will, having the
AfterUpdate event of one control change the InputMask of another control
is problematical. It would probably be a better idea to use the
BeforeUpdate event of the Postal Code control to determine if the code
is in the correct format, depending on the Country value. If the format
is incorrect set Cancel = True & display the error message.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQcMq94echKqOuFEgEQK64gCgpDramt0hk2RA1FCZLOU1Gc N0H1UAn2Jz
ItY8GSqunyKcbX3xg5huiy8f
=Lqdq
-----END PGP SIGNATURE-----
Paul wrote:
Hi everyone, here is the problem:

I have 2 fields...Province and PostalCode
The afterUpdate event of the province has this snippet of code:
...
...
If Country = "canada" Then PostalCode.InputMask = ">L0L\ 0L0;0;_"
docmd.gotocontrol "PostalCode"
...
...
NOTE: I can't put the input make in the table or on the fields property
for various reasons by choice. I need it to work as below.

The cursor moves as expected, but when I get to the Postal Code field, I
can type anything I want. Not until I try to leave the field does the
input mask tell me that my syntax is wrong that I did not type the
correct Postald Code. What it should be doing is restricting the entery
as I type it, like a normal input mask is designed to do.

I used an Immediate window to see what the ? postalcode was, and it
showed me the correct code.
So why is this not working, and better yet. How do I get it to work.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.