473,756 Members | 6,106 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access 97 - Input Mask

Hi everyone, here is the problem:

I have 2 fields...Provin ce and PostalCode
The afterUpdate event of the province has this snippet of code:
...
...
If Country = "canada" Then PostalCode.Inpu tMask = ">L0L\ 0L0;0;_"
docmd.gotocontr ol "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 3313
-----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:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQcMq94echKq OuFEgEQK64gCgpD ramt0hk2RA1FCZL OU1GcN0H1UAn2Jz
ItY8GSqunyKcbX3 xg5huiy8f
=Lqdq
-----END PGP SIGNATURE-----
Paul wrote:
Hi everyone, here is the problem:

I have 2 fields...Provin ce and PostalCode
The afterUpdate event of the province has this snippet of code:
...
...
If Country = "canada" Then PostalCode.Inpu tMask = ">L0L\ 0L0;0;_"
docmd.gotocontr ol "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******** *********@newsr ead1.news.pas.e arthlink.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:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQcMq94echKq OuFEgEQK64gCgpD ramt0hk2RA1FCZL OU1GcN0H1UAn2Jz
ItY8GSqunyKcbX3 xg5huiy8f
=Lqdq
-----END PGP SIGNATURE-----
Paul wrote:
Hi everyone, here is the problem:

I have 2 fields...Provin ce and PostalCode
The afterUpdate event of the province has this snippet of code:
...
...
If Country = "canada" Then PostalCode.Inpu tMask = ">L0L\ 0L0;0;_"
docmd.gotocontr ol "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
3341
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 checked the forms and tables, and the properties on these fields are all set with the proper input mask, but they display differently once merged with Word.
7
736
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 characters and ONLY NUMBERS should be inputted. Does anyone know what the validation rule should be for this field?
2
2911
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. The criteria is matching this linked SSN with an SSN that the user will input. I have an input mask on the SSN field (on the form only) but the dlookup is not working. I've tried the following 2 criterias: strCriteria = conQuote & _...
9
2061
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 additional code on my Postal/Zip Code field, using the fields "On Got Focus" event (Code Below) to manipulate the input mask. This procedure works well; however, I now wish to have a longer Value List of countries instead of using "Other", but I...
9
2959
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 i enter "THIS IS A TEST" on my form, i want the text box on my report to display: "T H I S I S A T E S T".
1
2817
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 changed and some computers have access 2000 and some have access 2003, where date format is 0000/00/00. Is there some way for input mask to change depending on access version? I know the date format will convert from 2000 to 2003 (I don't know if it'd...
9
1981
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 than I would have programmed, anyway). On everyday controls, everything acts normally. But on some controls (and they're always the same ones) the operator can't add or change data. Take a birthday field as an example. If the client was born...
2
19486
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 will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
21
7981
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 allow up to 8 characters, use the same domain always, and in a form be able to click and open an email to this customer. I have tried this in numerous ways, and I think it's occuring to me finally I can't do everything in one place. I think I might...
0
9271
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10028
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9868
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7242
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6533
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5139
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3804
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2664
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.