Public Sub ValidateID(ByVal IDno As String)
Dim a As Integer = 0
For i As Integer = 0 To 5
a += CInt(ID.Substring(i * 2, 1))
Next
Dim b As Integer = 0
For i As Integer = 0 To 5
b = b * 10 + CInt(ID.Substring(2 * i + 1, 1))
Next
b *= 2
Dim c As Integer = 0
Do
c += b Mod 10
b = CInt(Int(b / 10))
Loop Until b <= 0
c += a
Dim d As Integer = 0
d = 10 - (c Mod 10)
If (d = 10) Then d = 0
If (d = CInt(mID.Substring(12, 1))) And (IsDate("19" & mID.Substring(0, 2) & "/" & mID.Substring(2, 2) & "/" & mID.Substring(4, 2)) Or IsDate("20" & mID.Substring(0, 2) & "/" & mID.Substring(2, 2) & "/" & mID.Substring(4, 2))) Then
MessageBox.Show("Invalid ID number")
Else
ID = InputBox("Enter the Identity Number of the parrot")
End If
End Sub 'Validate
Public Sub ValidateID(ByVal IDno As String)
Dim a As Integer = 0
For i As Integer = 0 To 5
a += CInt(ID.Substring(i * 2, 1))
Next
Dim b As Integer = 0
For i As Integer = 0 To 5
b = b * 10 + CInt(ID.Substring(2 * i + 1, 1))
Next
b *= 2
Dim c As Integer = 0
Do
c += b Mod 10
b = CInt(Int(b / 10))
Loop Until b <= 0
c += a
Dim d As Integer = 0
d = 10 - (c Mod 10)
If (d = 10) Then d = 0
If (d = CInt(mID.Substring(12, 1))) And (IsDate("19" & mID.Substring(0, 2) & "/" & mID.Substring(2, 2) & "/" & mID.Substring(4, 2)) Or IsDate("20" & mID.Substring(0, 2) & "/" & mID.Substring(2, 2) & "/" & mID.Substring(4, 2))) Then
MessageBox.Show("Invalid ID number")
Else
ID = InputBox("Enter the Identity Number of the parrot")
End If
End Sub 'Validate