Una famiglia di sistemi di gestione per database relazionali di Microsoft progettati per semplificare l'uso.
Vedi se in questo modo abbiamo coperto tutte le possibilità della cifra di controllo:
Function fncTestMatricola(strMatricola As String) As Boolean
Dim dbSomma As Double
Dim intTemp As Integer
Dim intCounter As Integer
For intCounter = 1 To Len(strMatricola) - 1
If intCounter Mod 2 = 1 Then 'Posizioni Dispari
intTemp = Mid(strMatricola, intCounter, 1) * 2
If intTemp > 9 Then
dbSomma = dbSomma + Left(intTemp, 1) + Right(intTemp, 1)
Else
dbSomma = dbSomma + intTemp
End If
Else 'Posizioni Pari
dbSomma = dbSomma + Mid(strMatricola, intCounter, 1) * 1
End If
Next intCounter
If dbSomma Mod 10 = 0 Then
If Right(strMatricola, 1) = 0 Then
fncTestMatricola = True
Else
fncTestMatricola = False
End If
Else
If ((Int(dbSomma / 10) + 1) * 10) - dbSomma = Right(strMatricola, 1) Then
fncTestMatricola = True
Else
fncTestMatricola = False
End If
End If
End Function
David