473,396 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Access 97 - Input Mask

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
2 3296
-----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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Red&LimeStripes | last post by:
I am new here, so please bare with me. I have merged an Access query into Word, and the date field and time field display different input masks than how they are set up in Access. I have...
7
by: Mathew Hill | last post by:
I am a beginner to the more technical aspects of Microsoft Access (2000) and was wondering if any one can help? I have a field in a table called: ADMIN NUMBER This field should have 4...
2
by: Ellen Manning | last post by:
I've got an A2K database with a link to a table in another A2K database. This linked table contains SSN formatted with the SSN input mask. I'm trying to use a dlookup using this linked table. ...
9
by: Dave Brydon | last post by:
Access 2003: I currently apply my Postal/Zip Code Format based off the Country Selected; the way I do it is by checking on the country; using the forms "On Current" event procedure, then I use...
9
by: Paul | last post by:
hi, is there an input mask i could use on a report to do the following: (1) if i enter "THISISATEST" on my form, i want the text box on my report to display: "T H I S I S A T E S T". (2) if...
1
by: saddist | last post by:
Hello, I've been working on access 2000 for few days. I made some forms with textfields where you can type date. Those textfields had input mask set for short date 99/99/0000. Now software have...
9
by: Ron | last post by:
Hi All, I've recently installed a program written in Access 2000 on a laptop. The laptop had an existing Office 2000 Pro which of course included Access. But the program acts oddly (more oddly...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
21
by: DanicaDear | last post by:
I've been trying to figure this out for three weeks. I've been sleeping on it. Not getting answers, just losing sleep. ;-) In a table, I have a field COMPANY_EMAIL. In this field I want to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.