If Check1(1).Value Then
If Trim(txtName.Text) = "" Then
sMeg = "姓名不能为空"
MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
txtName.SetFocus
Exit Sub
Else
dd(1) = True
If dd(0) Then
txtSQL = txtSQL & "and student_Name = '" & txtName.Text & "'"
Else
txtSQL = txtSQL & "student_Name = '" & txtName.Text & "'"
End If
End If
End If
If Check1(2).Value Then
If Trim(txtCourse.Text) = "" Then
sMeg = "课程不能为空"
MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
txtCourse.SetFocus
Exit Sub
Else
dd(2) = True
If dd(0) Or dd(1) Then
txtSQL = txtSQL & "and course_Name = '" & txtCourse.Text & "'"
Else
txtSQL = txtSQL & "course_Name = '" & txtCourse.Text & "'"
End If
End If
End If
If Not (dd(0) Or dd(1) Or dd(2) Or dd(3)) Then
MsgBox "请设置查询方式!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
txtSQL = txtSQL & " order by student_ID "
Set mrc = ExecuteSQL(txtSQL, MsgText)
With myflexgrid
.Rows = 2
.CellAlignment = 4