PC Review


Reply
Thread Tools Rate Thread

credit card mod 10 validation

 
 
Zen Masta
Guest
Posts: n/a
 
      16th May 2006
https://www.azcode.com/Mod10/

I found this clever JavaScript and was wondering if anyone knows of a
similar one in vb for use in ms access... preferably one that can handle
hyphens separating the number groups.


 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      16th May 2006
You can use the Replace function to get rid of hyphens or spaces:

strCardNumber = Replace(Replace(strCardNumber, "-", ""), " ", "")

You can use the Mid function to look at each digit in the string in turn

For intLoop = 1 To Len(strCardNumber)
strCurrChar = Mid(strCardNumber, intLoop, 1)

Next intLoop

You can use the Mod function to determine whether a particular value of
intLoop is odd or even:

If intLoop Mod 2 = 0 Then
' intLoop is even
Else
'intLoop is odd
End If


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Zen Masta" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> https://www.azcode.com/Mod10/
>
> I found this clever JavaScript and was wondering if anyone knows of a
> similar one in vb for use in ms access... preferably one that can handle
> hyphens separating the number groups.
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Credit card validation =?Utf-8?B?U2FuZHk=?= Microsoft ASP .NET 7 13th May 2005 05:43 PM
Credit Card Validation Question Sparky Arbuckle Microsoft ASP .NET 2 7th Apr 2005 02:03 PM
Credit Card Validation Harold Microsoft Access 4 13th Feb 2004 04:55 AM
Credit Card Validation Grant Microsoft ASP .NET 6 21st Jul 2003 03:00 PM
Credit card number validation James Microsoft Access Form Coding 3 10th Jul 2003 03:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:02 PM.