Conditional input mask on form

J

Jon Peck

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!
 
J

Jeff L

In After Update event of the Payment Type put

If Me.PaymentType = "Credit Card" Then
Me.AccountNum.InputMask = "0000-0000-0000-0000"
Else
Me.AccountNum.InputMask = ""
End If

Hope that helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Input Mask Help 1
Input mask 4
Changing mask on form 0
Remove input mask format 4
date+time input mask 3
Input Mask - quick question 6
Date Input Mask Question 13
Input Mask vs Format 2

Top