473,396 Members | 1,766 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.

Conditional input mask on form

I'm largely self-taught (so hardly an expert) in Access 2002. I'm wondering
if it's possible to have a conditional input mask on a field in a form.

My database keeps track of people who register for a conference. They can
pay by credit card (Visa or MasterCard only), check or purchase order. I'd
like to be able to have an input mask so that I only have to type the digits
(1234567890123456) but the credit card numbers show up with easier-to-read
dashes in the usual spots (1234-5678-9012-3456). However, when the method of
payment is a check or purchase order, I don't want the dashes. Is it
possible to do this? I'm thinking the method, if there is one, would
involve use of the IIF function, and might be used on either the form, the
table or a query. Any guidance would be greatly appreciated. Thanks!
Oct 9 '06 #1
1 4180
ray
Jon,

What about a change of mask when the payment type is updated?

So, in the AfterUpdate event of the Select
CreditCard/Check/PurchaseOrder field, set the mask of the card/check/PO
to whatever you need:

Select case me!PaymentType
Case "CC"
me!PaymentNumber.InputMast = "000 ...... whatever"
Case "CH"
me!PaymentNumber.InputMast = "00990 ...... whatever"
Case "PO"
me!PaymentNumber.InputMast = "9999000 ...... whatever"
end select

Ray

Jon Peck wrote:
I'm largely self-taught (so hardly an expert) in Access 2002. I'm wondering
if it's possible to have a conditional input mask on a field in a form.

My database keeps track of people who register for a conference. They can
pay by credit card (Visa or MasterCard only), check or purchase order. I'd
like to be able to have an input mask so that I only have to type the digits
(1234567890123456) but the credit card numbers show up with easier-to-read
dashes in the usual spots (1234-5678-9012-3456). However, when the method of
payment is a check or purchase order, I don't want the dashes. Is it
possible to do this? I'm thinking the method, if there is one, would
involve use of the IIF function, and might be used on either the form, the
table or a query. Any guidance would be greatly appreciated. Thanks!
Oct 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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. ...
4
by: David W. Fenton | last post by:
I'm working on a subform where users put in 24-hour time. On their paper forms, they've been accustomed to referring to midnight as 24:00 (instead of as 0:00, which kind of makes sense from a human...
1
by: Miranda Evans | last post by:
In my application, a text box control resides in a form. The text box control is unbound, but--assuming all edits are passed when the user click a command button on the form--the contents of the...
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...
2
by: johnp | last post by:
Hi, Our Tech department updated users to Office 2003 this week. Now the input mask in one of the applications is showing up as: (###) ###-### The input mask wizard works correctly when I...
7
by: F. Michael Miller | last post by:
I have a db with Access front end, sql back, linked tables. I need to be able to change input masks at the table level in code. Any ideas? Thanks!
6
by: Regnab | last post by:
Morning All, I'm trying to ensure that when the user enters a number on a form, the database automatically leaves a space after the 3rd number. I've tried to do this using input masks, but when...
5
by: mtgrizzly52 | last post by:
First thing, because of you all and this web site, I am building a first class time saving database for my fellow workers to use. My really dumb questions is this. I have a control in a subform...
7
desklamp
by: desklamp | last post by:
I'm a total Access newbie, please bear with me! Using Win2K/Access 2003. I'm trying to create a table in which I can store IP addresses and other information. According to Microsoft, there is no...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.