D
DrONDeN
I'm trying to implement a Mod 11 data validation into ms access with a
custom weighting. The weighting is as follows:
Position: 9 8 7 6 5 4 3
2 1
Weighting: 6 3 7 9 10 5 8 4
2
Therefore the check digit for number 550015209 would be worked out as
follows:
1. Multiply each number by it's weighing according to position
Weighting: 6 3 7 9 10 5 8 4
2
number: 5 5 0 0 1 5 2
0 9
= 30 15 0 0 10 25 16 0
18
2. Add the products of step 1 together and minus 1
= 114 - 1 = 113
3. Mod 11 the product of step 2
= 113 mod 11 = 3
4. Subtract the product of step 3 from 11
= 11 - 3
5. Check digit = 8 Therefore the new number would be 5500152098
If the check digit = 10 then this is replaced by a hypen eg 552081815-
I would like to implement it so that when the reference number is
entered into a control bound to the reference number field, validation
is performed which checks that the number is valid using method above.
If not, then a message box is displayed warning of error and the text
box is cleared ready for a second attempt.
Is this possible using a query or would I have to use VB. Whichever
way, I would be enourmously grateful of any help pointing me in the
right direction on this one.
custom weighting. The weighting is as follows:
Position: 9 8 7 6 5 4 3
2 1
Weighting: 6 3 7 9 10 5 8 4
2
Therefore the check digit for number 550015209 would be worked out as
follows:
1. Multiply each number by it's weighing according to position
Weighting: 6 3 7 9 10 5 8 4
2
number: 5 5 0 0 1 5 2
0 9
= 30 15 0 0 10 25 16 0
18
2. Add the products of step 1 together and minus 1
= 114 - 1 = 113
3. Mod 11 the product of step 2
= 113 mod 11 = 3
4. Subtract the product of step 3 from 11
= 11 - 3
5. Check digit = 8 Therefore the new number would be 5500152098
If the check digit = 10 then this is replaced by a hypen eg 552081815-
I would like to implement it so that when the reference number is
entered into a control bound to the reference number field, validation
is performed which checks that the number is valid using method above.
If not, then a message box is displayed warning of error and the text
box is cleared ready for a second attempt.
Is this possible using a query or would I have to use VB. Whichever
way, I would be enourmously grateful of any help pointing me in the
right direction on this one.