收取金额流程图
代码实现
Private Sub cmdexport_Click()
Call ExportToExcel(MSFlexGrid1)
End Sub
Private Sub cmdinquery_Click()
Dim txtsql, msgtext As String
Dim mrc As Adodb.Recordset
'判断起始日期是否小于终止日期
If DTPicker1.Value < DTPicker2.Value Then
'查询退卡表
txtsql = "select * from recharge_info where datetime between '" & DTPicker1.Value & "' and '" & DTPicker2.Value & "' "
Set mrc = ExecuteSQL(txtsql, msgtext)
'判断是否有记录
If mrc.EOF And mrc.BOF Then
MsgBox "没有查询结果!", 0 + 48, 提示
Exit Sub
Else
With MSFlexGrid1
'设置表格行数和列数
.Rows = 1
.Cols = 6
'设置表格第一行的标题
.TextMatrix(0, 0) = "卡号"
.TextMatrix(0, 1) = "充值金额"
.TextMatrix(0, 2) = "充值日期"
.TextMatrix(0, 3) = "充值教师"
.TextMatrix(0, 4) = "结账状态"
'将数据添加到表格中
Do While mrc.EOF = False
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = mrc.Fields(1)
.TextMatrix(.Rows - 1, 1) = mrc.Fields(2)
.TextMatrix(.Rows - 1, 2) = mrc.Fields(3)
.TextMatrix(.Rows - 1, 3) = mrc.Fields(4)
.TextMatrix(.Rows - 1, 4) = mrc.Fields(5)
mrc.MoveNext
Loop
End With
End If
Else
MsgBox "起始日期不能大于终止日期!", 0 + 48, 提示
Exit Sub
End If
End Sub
退还金额流程图
代码实现
Private Sub cmdexport_Click()
'导出到excel
Call ExportToExcel(MSFlexGrid1)
End Sub
Private Sub cmdinquery_Click()
Dim txtsql, msgtext As String
Dim mrc As adodb.Recordset
'判断起始日期是否小于终止日期
If DTPicker1.Value < DTPicker2.Value Then
MsgBox "起始日期不能大于终止日期!", 0 + 48, 提示
Exit Sub
End If
'判断是否有记录
txtsql = "select * from cancelcard_info where datetime between '" & DTPicker1.Value & "' and '" & DTPicker2.Value & "' "
Set mrc = ExecuteSQL(txtsql, msgtext)
If mrc.EOF And mrc.BOF Then
MsgBox "没有查询结果", 0 + 48, 提示
Exit Sub
Else
'将查询结果显示在MSFlexgrid1中
With MSFlexGrid1
.Rows = 1
.Cols = 6
.TextMatrix(0, 0) = "卡号"
.TextMatrix(0, 1) = "退还金额"
.TextMatrix(0, 2) = "退还日期"
.TextMatrix(0, 3) = "结账人员"
.TextMatrix(0, 4) = "结账状态"
Do While Not mrc.EOF
.Rows = .Rows + 1
.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)
mrc.MoveNext
Loop
End With
End If
End Sub