casio262 > 16-04-12, 10:15 AM
Private Sub Command2_Click()
Dim i As Integer
Dim check As Integer
check = 0
If Forms![form2]![sOnt] = 0 Or Forms![form2]![sOnt] = 1 Then
MsgBox "ko phai la so nguyen to", 14, "Thong bao"
End If
For i = 2 To Sqr(sOnt)
If sOnt Mod i = 0 Then
check = 1
Exit For
End If
Next
If check = 0 Then
MsgBox "La so nguyen to", 14, "Thong bao"
Else
MsgBox "Ko phai la so nguyen to", 14, "Thong Bao"
End If
End Sub