机房收费系统中管理员可以对操作员进行结账操作。
窗体界面:

结账用到了SSTab选项卡,SSTab的添加:添加SSTab选项卡
每一个选项下面对应的连接数据库和想要查询的内容都是不一样的。
代码展示:
Private Sub SSTab1_Click(PreviousTab As Integer)
Dim txtSQL As String
Dim MsgText As String
Dim mrc As Recordset
Select Case SSTab1.Tab
Case 0 '显示购卡
MSHFlexGrid1.Rows = 1
With MSHFlexGrid1
.CellAlignment = 4
.TextMatrix(0, 0) = "学号"
.TextMatrix(0, 1) = "卡号"
.TextMatrix(0, 2) = "日期"
.TextMatrix(0, 3) = "时间"
End With
'连接数据库 student 表
txtSQL = "select * from student_info where UserID='" & Trim(ComboUserID.Text) & "'and Ischeck='" & "未结账" & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
Do While Not mrc.EOF
With MSHFlexGrid1
.Rows = .Rows + 1
.CellAlignment = 4
.TextMatrix(.Rows - 1, 0) = mrc.Fields(1)
.TextMatrix(.Rows - 1, 1) = mrc.Fields(0)
.TextMatrix(.Rows - 1, 2) = mrc.Fields(12)
.TextMatrix(.Rows - 1, 3) = mrc.Fields(13)
'移动到下一条记录
mrc.MoveNext
End With
Loop
mrc.Close
Case 1 '显示充值
MSHFlexGrid2.Rows = 1
With MSHFlexGrid2
.CellAlignment = 4
.TextMatrix(0, 0) = "学号"
.

最低0.47元/天 解锁文章
891

被折叠的 条评论
为什么被折叠?



