前言:详细介绍各个地方的逻辑书写,流程图以及重要代码。
逻辑说明:
- 结果图:
-
from设置
1). 定义窗口大小
2)加载cbo中的所有相关人员
3)设置加载时候MSF的标题
-
cbo控件书写
1)显示名字
2)调用过程
-
结账修改记录
1)将学生、充值、退卡都换成已结账
2)清空文本框
-
过程
1)结算所有价钱和记录放到MSF 中去
2)汇总到结账的页面的总表中
-
每个控件设定限制符
1)设定ASCII码
- 日结账单
- 周结账单
重要代码运用:
- 显示姓名
If cboUserID.Text = "" Then
Text1.Text = ""
Else
txtSQL = "select * from user_info where userID='" & cboUserID.Text & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
Text1.Text = Trim(mrc.Fields() & "")
mrc.Close
End If
-
修改表中的SQL语句:
‘调用未结账并且管理员是相同的
txtSQL = "select * from student_info where Ischeck='未结账' and UserID='" & cboUserID.Text & "'"
Set mrcSD = ExecuteSQL(txtSQL, MsgText)
- While循环
While mrcSD.EOF = False
mrcSD.Fields() = "已结账"
mrcSD.Update
mrcSD.MoveNext
Wend
- cbo中显示所有的相关人员:
txtSQL = "select * from user_info where level='操作员'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
Do While Not mrc.EOF
cboUserID.AddItem Trim(mrc.Fields())
mrc.MoveNext
N = N +
Loop
- 初始化表格:
With MSFGK
.Rows = '表示在第一行就显示信息
.CellAlignment = '居中
.TextMatrix(, ) = "学号" 'studentid
.TextMatrix(, ) = "卡号" 'cardid
.TextMatrix(, ) = "日期" 'date
.TextMatrix(, ) = "时间" 'time
.TextMatrix(, ) = "金额" 'cash
End With
- 调用SQL未结账:
txtSQL = "select studentNo,cardno,date,time,cash from student_Info where Ischeck= '未结账' and UserID= '" & cboUserID.Text & "'"
Set mrcSD = ExecuteSQL(txtSQL, MsgText)
则:mrc.fields(0)=studentno