Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
Dim MsgText As String
Dim txtSQL As String
If Not Testtxt(txtClassno.Text) Then
MsgBox "请输入班号!", vbOKOnly + vbExclamation, "警告"
txtClassno.SetFocus
Exit Sub
End If
If Not Testtxt(comboGrade.Text) Then
MsgBox "请选择年级!", vbOKOnly + vbExclamation, "警告"
comboGrade.SetFocus
Exit Sub
End If
If Not Testtxt(txtDirector.Text) Then
MsgBox "请输入班主任姓名!", vbOKOnly + vbExclamation, "警告"
txtDirector.SetFocus
Exit Sub
End If
If Not Testtxt(txtClassroom.Text) Then
MsgBox "请输入教室房间号!", vbOKOnly + vbExclamation, "警告"
txtClassroom.SetFocus
Exit Sub
End If
If Not IsNumeric(Trim(txtClassno.Text)) Then
MsgBox "请输入数字!", vbOKOnly + vbExclamation, "警告"
Exit Sub
txtClassno.SetFocus
End If
txtSQL = "select * from class_Info "
Set mrc = ExecuteSQL(txtSQL, MsgText)
mrc.MoveFirst
While (mrc.EOF = False)
If (Trim(mrc.Fields(0)) = Trim(txtClassno.Text)) Then
MsgBox "班号已经存在,请重新输入班号!", vbOKOnly + vbExclamation, "警告"
<< 上一页 [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] ... 下一页 >>