If Len(Account Number) Dim Weighted Digits One As Integer Dim Weighted Digits Two As Integer Dim Mod Digit One As Byte Dim Mod Digit Two As Byte Dim Control Digit One As Byte Dim Control Digit Two As Byte 'Converts Account Number into Integer, and then creates array of individual bank account digits.'Apply Weights to the first eight digits of the code, then add together.If Len(Account Number) 20 _ Then SPAINBANK = False Else 'Declaring stuff.
The payment model of "pay per click" means you can install Bank Check on as many PCs as you require and you only pay for your usage.
(The software is free to download on as many PCs as you wish).
The mod 11 of this 'is subtracted from 11 for the second control digit. Weighted Digits Two = (Bank Digit(10) * 1) _ (Bank Digit(11) * 2) _ (Bank Digit(12) * 4) _ (Bank Digit(13) * 8) _ (Bank Digit(14) * 5) _ (Bank Digit(15) * 10) _ (Bank Digit(16) * 9) _ (Bank Digit(17) * 7) _ (Bank Digit(18) * 3) _ (Bank Digit(19) * 6) Mod Digit Two = 11 - (Weighted Digits Two Mod 11) If Mod Digit Two = 10 _ Then Control Digit Two = 1 Else Control Digit Two = Mod Digit Two End If 'Compares the 9th digit of the account number to what we calculated as the first control digit, 'Compares the 10th digit of the account number to what we calculated as the second control digit, 'If both match, returns true, if one of both of them is wrong returns false If Bank Digit(8) = Control Digit One And Bank Digit(9) = Control Digit Two _ Then SPAINBANK = True Else SPAINBANK = False End If End If ' Closing If at the top of function End Function Hello id107 and Cindy Many thanks for your fast replies.
I have amended the line of code as suggested, but it now returns #VALUE!
In particular, when accepting paperless direct debit instructions it is mandatory that you perform an ISCD lookup and modulus check at the time of accepting the instruction.
Bank Check does just that for you, it ensures your sort code and account number are checked and accurate from the start.
Bank Check is a web based service to allow you to easily validate bank sort codes and bank account numbers at point of entry.
You may not need the ability to build Bank Check into your own application so we also provide a simple Windows App which does the job of verifying the sortcode and bank account number for you.
' 'Spanish bank accounts are 20 digits (AAAABBBBCDEEEEEEEEEE) 'AAAA is the bank corporation code, its the company itself 'BBBB is the bank branch, individual offices 'C is the first control digit, it is calculated from AAAA and BBBB 'D is the second control digit, it is calculated from EEEEEEEEEE 'EEEEEEEEEE is the customers bank account number ' 'This function calculates C and D and compares them to the values supplied in the string.