📄 main_qtgl_rjzfx.frm
字号:
End
Begin VB.Frame Frame2
Height = 690
Left = 15
TabIndex = 2
Top = 4695
Width = 9990
Begin VB.CommandButton ComEnd
Caption = "退出当日结账数据分析"
Height = 390
Left = 7905
TabIndex = 4
Top = 165
Width = 1995
End
Begin VB.Label Labhjje
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 225
Left = 5220
TabIndex = 8
Top = 315
Width = 2175
End
Begin VB.Label Labhjsl
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Left = 2805
TabIndex = 7
Top = 315
Width = 930
End
Begin VB.Label Labjl
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 225
Left = 840
TabIndex = 6
Top = 315
Width = 930
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "单据数: 合计数量: 合计金额:"
Height = 255
Left = 90
TabIndex = 5
Top = 315
Width = 5295
End
End
Begin VB.Frame Frame1
Height = 4770
Left = 0
TabIndex = 0
Top = -60
Width = 2640
Begin MSAdodcLib.Adodc Adodc3
Height = 375
Left = 390
Top = 2355
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc3"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc2
Height = 390
Left = 375
Top = 1845
Visible = 0 'False
Width = 1770
_ExtentX = 3122
_ExtentY = 688
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc1
Height = 360
Left = 420
Top = 1410
Visible = 0 'False
Width = 1740
_ExtentX = 3069
_ExtentY = 635
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text1
Height = 285
Left = 60
TabIndex = 10
Top = 2760
Visible = 0 'False
Width = 1650
End
Begin MSComctlLib.ImageList ImageList1
Left = 150
Top = 2400
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 56
ImageHeight = 51
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_qtgl_rjzfx.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_qtgl_rjzfx.frx":21CC
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.TreeView TreeView1
Height = 4425
Left = 90
TabIndex = 1
Top = 180
Width = 2475
_ExtentX = 4366
_ExtentY = 7805
_Version = 393217
Style = 7
ImageList = "ImageList1"
Appearance = 1
End
End
End
Attribute VB_Name = "main_qtgl_rjzfx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer '定义整型变量
Dim sqlStr1 As String
Private nod As Node '定义Node对象
Private Sub Form_Activate() '添加房台列表
Dim rs As New ADODB.Recordset
Sql = "select * from 房间台号信息表 order by 编号"
Call FunAdo(Adodc1, Sql)
Adodc1.Refresh
key = "房台信息"
text = "请选择所需房台"
Set Node1 = TreeView1.Nodes.Add(, , key, text, 1) '设置TreeView1控件的节点 文本 和 图标(另外:1 为ImageList控件图标的索引值)
If Adodc1.Recordset.RecordCount > 0 Then
Dim key_i As Integer
Adodc1.Recordset.MoveFirst
Do While Adodc1.Recordset.EOF = False
key = Trim(Adodc1.Recordset.Fields("房台名称"))
key = key & key_i & "*"
text = "(" & Trim(Adodc1.Recordset.Fields("编号")) & ")" & Trim(Adodc1.Recordset.Fields("房台名称"))
sqlStr = "select * from 日结账表 where 房台编号='" & Adodc1.Recordset.Fields("编号") & "'"
rs.Open sqlStr, cnn, adOpenStatic, adLockReadOnly
If rs.RecordCount > 0 Then
Set Node2 = TreeView1.Nodes.Add(Node1.Index, tvwChild, key, text, 2) '将房台名称,添加到TreeView控件中
Else
Set Node2 = TreeView1.Nodes.Add(Node1.Index, tvwChild, key, text, 1) '将房台名称,添加到TreeView控件中
End If
rs.Close
Adodc1.Recordset.MoveNext
key_i = key_i + 1
Loop
End If
Me.Caption = Me.Caption & " " & frm_main.St1.Panels(3).text
End Sub
Private Sub Form_Load()
Sql = "select * From 房间台号信息表 "
sqlStr = "select * From 日点单信息表 "
sqlStr1 = "select * From 日点单信息表 "
Call FunAdo(Adodc1, Sql)
Call FunAdo(Adodc2, sqlStr)
Call FunAdo(Adodc3, sqlStr1)
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True '设置主窗体有效
End Sub
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
Text1.text = Right(Left(TreeView1.SelectedItem.text, 4), 3)
sqlStr = "select * from 日点单信息表 where 房台编号='" + Text1.text + "'"
Call FunAdo(Adodc2, sqlStr)
Adodc2.Refresh '查询日点单信息
Set DataGrid1.DataSource = Adodc2
'统计数量、金额
sqlStr1 = "select count(*)as 记录,sum(数量)as 数量合计,sum(金额)as 金额合计 from 日点单信息表 where 房台编号='" + Text1.text + "'"
Call FunAdo(Adodc3, sqlStr1)
Adodc3.Refresh
If Adodc3.Recordset.Fields(0) <> "" Then Labjl.Caption = Adodc3.Recordset.Fields(0) Else Labjl.Caption = "0"
If Adodc3.Recordset.Fields(1) <> "" Then Labhjsl.Caption = Adodc3.Recordset.Fields(1) Else Labhjsl.Caption = "0"
If Adodc3.Recordset.Fields(2) <> "" Then Labhjje.Caption = Format(Adodc3.Recordset.Fields(2), "0.00") & " 元" Else Labhjje.Caption = "0.00 元"
End Sub
Private Sub comend_Click()
frm_main.Enabled = True
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -