Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a checkdigit validation

Status
Not open for further replies.

hjohnson

Programmer
Aug 1, 2001
90
US
This may not be the best subject for the question, but not sure how else to word it.

I'm looking for suggestions on how to identify data in tables that users have manipulated outside of the application (like ms query or VB), perhaps a check digit based on two or more fields that would validate the record.

The reason this would be useful is that a couple of occasion, we have had some rather techinical users either create new records and/or modify records the get the result they wanted but then caused problems with other process that expect the previous values.

If this makes any sense at all, I would appreciate any thoughts, suggestions or ideas that others have or solutions that other have implemented.

Thanks a million and happy holidays

Hal
 
You could use SYS(2007):

?SYS(2007, 'You could use')
returns 23680.
Dave S.
 
Hi

In your table you can add a field .. let us say..
RecValid Type Numeric Integer. (I am not calling it checksum to avoid normal people knowing what it is.

Then you can replace the value of the CheckSUm of the record in this field.

Let us say.. you have..
field1, field2, field3 etc in your table..
If field1, field2 are index type fields and you dont want
any one to change... then
REPLACE Recvalid WITH SYS(2007,field1+field2)
If field1 or field2 is numeric .. convert them using...
STR(field1)+field2 or whatever...

The rest of the fields you can allow to be changed.

When you want to fish out direct entries into the modification.. you can do an SQL

SELECT * FROM myTable ;
WHERE RecBalid # SYS(2007,field1+field2)
and get the culprits ... :)
ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
I have a data entry form with two(2) textboxes, txtAccNo & txtCkDigit.

------------------- ----
Account # | || |
------------------- ----


What I need to accomplish is validation of the 12-digit txtAccNo, so that when a clerk enters the Account Number and Check Digit, it validates according to the folowing rules:


WEIGHT TABLE
Letter A B C D E F G H I J K L
Weight Factor 13 12 11 10 9 8 7 6 5 4 3 2



1. Each digit, from left to right, is multiplied by the number below it and the weighted sums are totalled to give a weighted total, mWTotal.
I.E.

mWTotal = ((A*13) + (B*12) + (C*11) + (D*10)...+ (L*2))

2. This weighted total is then divided by 11 to give a remainder, mRemain

3. mRemain is then subtracted from 11 to give a two-digit check sum

4. If mCkSum < 10
ckDigit = mCkSum
Else
ckDigit = 0
Endif

I am not sure exactly how to tackle this problem, since it seems to me that it smells of an ARRAY and I have no experience of them. The HELP topics just don't give me any ideas... :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top