前言
在学生系统中,查询窗体共有两个,分别是:查询学籍信息窗体和查询成绩信息窗体。那关于查询信息的流程我做了流程图,经过这样一番梳理,思路清晰,逻辑分明,下面上图。
代码片段
查询窗体中判断选择查询方式代码如下:
If Check1(0).Value Then
……
dd(0) = True
txtSQL = ……
End If
If Check1(1).Value Then
……
dd(1) = True
If dd(0) Then
……
End If
End If
If Check1(2).Value Then
……
dd(2) = True
If dd(0) or dd(1) Then
……
End If
End If
查询窗体中添加表格以及判断记录集对象是否为最后一个记录的代码如下:
With myFlexGrid
.Rows = 2
.CellAlignment = 4
.TextMatrix(1, 0) = "考试编号"
.TextMatrix(1, 1) = "学号"
.TextMatrix(1, 2) = "姓名"
.TextMatrix(1, 3) = "班号"
.TextMatrix(1, 4) = "课程名称"
.TextMatrix(1, 5) = "分数"
Do While Not mrc.EOF
.Rows = .Rows + 1
.CellAlignment = 4
.TextMatrix(.Rows - 1, 0) = mrc.Fields(0)
.TextMatrix(.Rows - 1, 1) = mrc.Fields(1)
.TextMatrix(.Rows - 1, 2) = mrc.Fields(2)
.TextMatrix(.Rows - 1, 3) = mrc.Fields(3)
.TextMatrix(.Rows - 1, 4) = mrc.Fields(4)
.TextMatrix(.Rows - 1, 5) = mrc.Fields(5)
mrc.MoveNext
Loop
End With
结语
关于学生系统的思路梳理部分就到这,经过梳理取得了进步,但是还需要不断的学习。接下来,是学生系统的优化,很期待~