Input mask for Credit Card

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Is there any way to create a input mask to put the hyphen's between each
group of 4 numbers in a credit card field?
The added difficulty is the while most CC's have 4 groups of 4 numbers, Am
Express has 4, 4, 4 and 3



Thanks in advance
D
 
Dave, in general, I find Input Masks to be counter-productitive. They slow
down a good data entry person; it's not easy to jump within the field, and
if you miss it character, it's not easy to insert it.

For this particular case, the problem is hightened by the fact that they are
not all 16 digits. I haven't checked recently, but Diner, JCB and
CarteBlanch used to be 14 digits, Amex was 15, and who knows what others may
be introduced in the future.

Others may have a better idea, but what I do is allow the free-form, and run
some validation in the AfterUpdate of the text box. This doesn't guarantee
the card is operational, of course, but it does catch most of the
incorrectly entered numbers. This kind of thing:
http://worldwidemart.com/scripts/readme/ccver.shtml
 
Allen,
Thanks for the reply.
I appreciate your input on just using a validator however I believe the user
will still prefer an imput mask.

Is there a way to do that?

Second - if I am able to perswade the used to use the valader the link you
provided to Matts scripts is for web based valadiating.
Is there such code for access (2003)?

Thanks again.
D
 
If you wish, you can use some optional digits in the input mask. Might look
odd though.

If you can't download the code and adapt it to VBA, I can post some for you.
 
"If you can't download the code and adapt it to VBA, I can post some for
you"

Allen,
That would be great. (Hope it is not above my head). I am thinking I can
"sell" the user that valadation is better (more usefull) then hyphen's.

Thanks much
 
Got it working. Thanks so much.

DO you happen to know how current the algorithem is?
We are only using AmEx Visa And Master Card

Thanks again
D
 
AFAIK, it works fine for Amex, Visa, and MasterCard.

If necessary, you can selectively choose to not apply the check sum or add
other ranges in the table.
 
Thank you again
D
Allen Browne said:
AFAIK, it works fine for Amex, Visa, and MasterCard.

If necessary, you can selectively choose to not apply the check sum or add
other ranges in the table.
 

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

Back
Top