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
hoanglonglangtu > 16-04-12, 10:29 AM
casio262 > 16-04-12, 10:34 AM
casio262 > 16-04-12, 10:55 AM
hoanglonglangtu > 16-04-12, 11:55 AM
casio262 > 16-04-12, 04:20 PM
Private Sub Command2_Click()
Dim i As Integer
Dim check As Integer
check = 0
If Forms![songuyento]![sOnt] = 0 Or Forms![songuyento]![sOnt] = 1 Then
MsgBox "ko phai la so nguyen to", 14, "Thong bao"
Exit Sub
Else
If Forms![songuyento]![sOnt] <> Null Then
For i = 2 To Sqr(sOnt)
If sOnt Mod i = 0 Then
check = 1
MsgBox "Ko phai la so nguyen to", 14, "Thong Bao"
Exit For
End If
Next
If check = 0 Then
MsgBox "La so nguyen to", 14, "Thong bao"
End If
Else
If Forms![songuyento]![sOnt] = Null Then
MsgBox "Khong duoc de trong", 14, "Thong Bao"
End If
End If
End If
End Sub
hoanglonglangtu > 16-04-12, 04:34 PM
casio262 > 16-04-12, 04:38 PM
hoanglonglangtu > 16-04-12, 04:54 PM
casio262 > 16-04-12, 05:00 PM