Private Sub Command1_Click()
Dim A As Integer
Dim num As Long
Dim N As Long
Dim C As Integer
Dim L As Integer
A = Right(Text1.Text, 1) 'Çæáíä ÚÏÏ ÇÒ ÓãÊ 
num = Left(Text1.Text, 9)
L = 2
For I = 1 To 9
If Len(Text1.Text) < 8 Then
A = MsgBox("National code numbers must be at least 8 digits", , "Error in entering the national code")
End If
If Text1.Text = "1111111111" Or Text1.Text = "2222222222" Or Text1.Text = "3333333333" Or Text1.Text = "4444444444" Or Text1.Text = "5555555555" Or Text1.Text = "6666666666" Or Text1.Text = "7777777777" Or Text1.Text = "8888888888" Or Text1.Text = "9999999999" Then
A = MsgBox("Error in entering the national code", , "worning")
End If
If Text1.Text = "1111111111" Or Text1.Text = "2222222222" Or Text1.Text = "3333333333" Or Text1.Text = "4444444444" Or Text1.Text = "5555555555" Or Text1.Text = "6666666666" Or Text1.Text = "7777777777" Or Text1.Text = "8888888888" Or Text1.Text = "9999999999" Then Exit For

If Len(Text1.Text) < 8 Then Exit For
N = num Mod 10
num = num \ 10
Z = N * L
Sum = Sum + Z
L = L + 1
Next
C = Sum Mod 11
If C < 2 And A = C Or C >= 2 And A = 11 - C Then Label1.Caption = "National code is correct" Else Label1.Caption = "National code is wrong"

End Sub