📄 frmsf.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomct2.ocx"
Begin VB.Form frmSF
BorderStyle = 3 'Fixed Dialog
Caption = "就餐记录查询"
ClientHeight = 7170
ClientLeft = 30
ClientTop = 420
ClientWidth = 9430
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7170
ScaleWidth = 9430
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "按卡号排序"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 370
Left = 120
TabIndex = 9
Top = 1200
Width = 1810
End
Begin VB.CommandButton Command2
Caption = "按时间排序"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 370
Left = 2160
TabIndex = 8
Top = 1200
Width = 1810
End
Begin VB.CommandButton Command3
Caption = "按卡号汇总"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 370
Left = 4200
TabIndex = 7
Top = 1200
Width = 1810
End
Begin VB.CommandButton Command4
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 370
Left = 7200
TabIndex = 6
Top = 1200
Width = 1695
End
Begin VB.Frame Frame1
Caption = "数据日期"
BeginProperty Font
Name = "宋体"
Size = 11.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 120
TabIndex = 0
Top = 120
Width = 8775
Begin MSComCtl2.DTPicker DTPicker2
Height = 375
Left = 3600
TabIndex = 1
Top = 360
Width = 1815
_ExtentX = 3210
_ExtentY = 670
_Version = 393216
Format = 21168129
CurrentDate = 38828
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 960
TabIndex = 2
Top = 360
Width = 1815
_ExtentX = 3210
_ExtentY = 670
_Version = 393216
Format = 21168129
CurrentDate = 38828
End
Begin VB.Label Label1
Caption = "从:"
BeginProperty Font
Name = "宋体"
Size = 11.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 360
TabIndex = 4
Top = 360
Width = 975
End
Begin VB.Label Label1
Caption = "到:"
BeginProperty Font
Name = "宋体"
Size = 11.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 3120
TabIndex = 3
Top = 360
Width = 975
End
End
Begin MSComctlLib.ListView ListView1
Height = 5050
Left = 120
TabIndex = 5
Top = 1680
Width = 8900
_ExtentX = 15699
_ExtentY = 8908
LabelWrap = -1 'True
HideSelection = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 11.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 0
End
Begin VB.Label labMoney
Caption = "充值交易总额:23456"
BeginProperty Font
Name = "黑体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 260
Left = 6240
TabIndex = 10
Top = 6840
Width = 2780
End
End
Attribute VB_Name = "frmSF"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim txtMoney As Currency
Dim rs As New ADODB.Recordset
Dim pssql As String
Dim stDate1 As String
Dim stDate2 As String
Private Sub Command1_Click() '按卡号排序
'pssql = "select * from LinkAddMoneyBuffer order by m1_cardid,m1_cdate,m1_ctime"
stDate1 = Format(DTPicker1.value, "yyyy-mm-dd")
stDate2 = Format(DTPicker2.value, "yyyy-mm-dd")
If stDate1 > stDate2 Then
MsgBox "开始日期不能大于结束日期!", vbCritical + vbOKOnly, "警告"
Exit Sub
End If
pssql = "select * from linksfmoney where m1_date>='" & stDate1 & "' and m1_date<='" & stDate2 & "'order by m1_cardid,m1_date"
Call listrecord
End Sub
Private Sub Command2_Click()
'pssql = "select * from LinkAddMoneyBuffer order by m1_cdate,m1_ctime,m1_cardid"
stDate1 = Format(DTPicker1.value, "yyyy-mm-dd")
stDate2 = Format(DTPicker2.value, "yyyy-mm-dd")
If stDate1 > stDate2 Then
MsgBox "开始日期不能大于结束日期!", vbCritical + vbOKOnly, "警告"
Exit Sub
End If
pssql = "select * from linksfmoney where m1_date>='" & stDate1 & "' and m1_date<='" & stDate2 & "'order by m1_date,m1_cardid"
Call listrecord
End Sub
Private Sub Command3_Click() '按操作员汇总
Dim L As ListItem
Dim i As Integer
stDate1 = Format(DTPicker1.value, "yyyy-mm-dd")
stDate2 = Format(DTPicker2.value, "yyyy-mm-dd")
If stDate1 > stDate2 Then
MsgBox "开始日期不能大于结束日期!", vbCritical + vbOKOnly, "警告"
Exit Sub
End If
txtMoney = 0
ListView1.ColumnHeaders.Clear
ListView1.ListItems.Clear
ListView1.View = lvwReport
ListView1.ColumnHeaders.Add , , "操作员", 1800
ListView1.ColumnHeaders.Add , , "充值金额", 1800
pssql = "select M1_CardID,sum(m1_money) as M1_Money from linksfmoney where m1_date>='" & stDate1 & "' and m1_date<='" & stDate2 & "' group by M1_CardID"
Set rs = GetRecordset(maSys_Sql, pssql)
Do While Not rs.EOF
Set L = ListView1.ListItems.Add(, "a" + CStr(i), CStr(rs!M1_CardID))
'L.ForeColor = vbRed
L.ListSubItems.Add , , rs!m1_money
txtMoney = txtMoney + rs!m1_money
rs.MoveNext
i = i + 1
Loop
labMoney = "充值交易总额:" & Format(CStr(txtMoney), "000000.00")
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
''''''' pssql = "select * from LinkAddMoneyBuffer order by m1_cardid,m1_cdate,m1_ctime"
''''''' Call listrecord
Me.Top = (Screen.Height - Me.Height) / 2 + 200
Me.Left = (Screen.Width - Me.Width) / 2
DTPicker1.value = Format(Now, "yyyy-mm-dd")
DTPicker2.value = Format(Now, "yyyy-mm-dd")
stDate1 = Format(DTPicker1.value, "yyyy-mm-dd")
stDate2 = Format(DTPicker2.value, "yyyy-mm-dd")
pssql = "select * from linksfmoney where m1_date>='" & stDate1 & "' and m1_date<='" & stDate2 & "'order by m1_cardid,m1_date"
Call listrecord
End Sub
Private Sub listrecord()
Dim L As ListItem
Dim i As Integer
txtMoney = 0
ListView1.ColumnHeaders.Clear
ListView1.ListItems.Clear
ListView1.View = lvwReport
ListView1.ColumnHeaders.Add , , "卡号", 1800
ListView1.ColumnHeaders.Add , , "姓名", 1800
ListView1.ColumnHeaders.Add , , "消费金额", 1200
ListView1.ColumnHeaders.Add , , "余额", 1200
ListView1.ColumnHeaders.Add , , "时间", 2300
Set rs = GetRecordset(maSys_Sql, pssql)
Do While Not rs.EOF
Set L = ListView1.ListItems.Add(, "a" + CStr(i), CStr(rs!M1_CardID))
'L.ForeColor = vbRed
L.ListSubItems.Add , , rs!m1_name
L.ListSubItems.Add , , rs!m1_money
L.ListSubItems.Add , , rs!m1_balance
L.ListSubItems.Add , , rs!m1_date
txtMoney = txtMoney + rs!m1_money
rs.MoveNext
i = i + 1
Loop
rs.Close
labMoney = "充值交易总额:" & Format(CStr(txtMoney), "000000.00")
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -