📄 main_czgl_ddxx.frm
字号:
TabIndex = 8
Top = 555
Width = 555
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "简要说明:"
Height = 255
Index = 6
Left = 4770
TabIndex = 7
Top = 555
Width = 930
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 0
Left = 735
TabIndex = 6
Top = 240
Width = 1215
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 1
Left = 1080
TabIndex = 5
Top = 540
Width = 1215
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 2
Left = 3405
TabIndex = 4
Top = 255
Width = 1200
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 3
Left = 3090
TabIndex = 3
Top = 525
Width = 1215
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 4
Left = 5550
TabIndex = 2
Top = 255
Width = 915
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 5
Left = 5700
TabIndex = 1
Top = 510
Width = 1995
End
End
End
Attribute VB_Name = "main_czgl_ddxx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Dim s, sqlStr1, sqlStr2, sqlStr3, sqlStr4 As String
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Activate()
On Error GoTo err1
If js.text = "1" Then
Sql = "select * from 月点单信息表 where 月点单信息表.单据号='" + Trim(main_czgl_yjzfx.Adodc2.Recordset.Fields("结账单据号")) + "'"
Call FunAdo(Adodc1, Sql)
Adodc1.Refresh
Set DataGrid2.DataSource = Adodc1 '将DataGrid2控件梆定到Adodc1
If Adodc1.Recordset.RecordCount > 0 Then
rs1.Open "select * from 房间台号信息表 where 房间台号信息表.编号='" + Trim(Adodc1.Recordset.Fields("房台编号")) + "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then '记录大于0,查询的记录存在,并赋值给Label标签 显示出来
Label4(0).Caption = Trim(rs1.Fields("编号")) 'Trim函数去掉字符串前后的(不包含字符串中的空格)的空格
Label4(1).Caption = Trim(rs1.Fields("房台名称"))
Label4(2).Caption = Trim(rs1.Fields("类型说明"))
Label4(3).Caption = Trim(rs1.Fields("部门"))
Label4(4).Caption = Trim(rs1.Fields("服务费"))
Label4(5).Caption = Trim(rs1.Fields("简要说明"))
End If
rs1.Close '关闭记录集
Labbh.Caption = Trim(Adodc1.Recordset.Fields("服务员编号")) 'Trim函数去掉字符串前后的(不包含字符串中的空格)的空格,
Labxm.Caption = Trim(Adodc1.Recordset.Fields("服务员姓名"))
labdjh.Caption = Trim(Adodc1.Recordset.Fields("单据号"))
'统计月点单 点单数量和金额
Sql = "select 状态 as 状态1,sum(数量)as 数量1,sum(金额)as 金额合计 from 月点单信息表 where 月点单信息表.单据号='" + Trim(main_czgl_yjzfx.Adodc2.Recordset.Fields("结账单据号")) + "'group by 状态"
Call FunAdo(Adodc2, Sql)
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 1 Then
Label2(0).Caption = Adodc2.Recordset.Fields(1)
'使用Format函数将数据格式为“0.00”格式
Label2(1).Caption = Format(Adodc2.Recordset.Fields(2), "0.00")
If Adodc2.Recordset.EOF = False Then Adodc2.Recordset.MoveNext
Label2(2).Caption = Adodc2.Recordset.Fields(1)
Label2(3).Caption = Format(Adodc2.Recordset.Fields(2), "0.00")
Else
If Trim(Adodc2.Recordset.Fields("状态1")) = "点单" Then
Label2(0).Caption = Adodc2.Recordset.Fields(1)
Label2(1).Caption = Format(Adodc2.Recordset.Fields(2), "0.00")
Label2(2).Caption = "0"
Label2(3).Caption = "0.00"
Else
Label2(0).Caption = "0"
Label2(1).Caption = "0.00"
Label2(2).Caption = Adodc2.Recordset.Fields(1)
Label2(3).Caption = Format(Adodc2.Recordset.Fields(2), "0.00")
End If
End If
End If
End If
If js.text = "2" Then
sqlStr1 = "select * from 点单历史表 where 点单历史表.单据号='" + Trim(main_czgl_njzfx.Adodc1.Recordset.Fields("结账单据号")) + "'"
Call FunAdo(Adodc3, sqlStr1)
Adodc3.Refresh
Set DataGrid2.DataSource = Adodc3
If Adodc3.Recordset.RecordCount > 0 Then
rs1.Open "select * from 房间台号信息表 where 房间台号信息表.编号='" + Trim(Adodc3.Recordset.Fields("房台编号")) + "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
Label4(0).Caption = Trim(rs1.Fields("编号"))
Label4(1).Caption = Trim(rs1.Fields("房台名称")) 'Trim函数去掉字符串前后的(不包含字符串中的空格)的空格,
Label4(2).Caption = Trim(rs1.Fields("类型说明"))
Label4(3).Caption = Trim(rs1.Fields("部门"))
Label4(4).Caption = Trim(rs1.Fields("服务费"))
Label4(5).Caption = Trim(rs1.Fields("简要说明"))
End If
rs1.Close
Labbh.Caption = Trim(Adodc3.Recordset.Fields("服务员编号"))
Labxm.Caption = Trim(Adodc3.Recordset.Fields("服务员姓名"))
labdjh.Caption = Trim(Adodc3.Recordset.Fields("单据号"))
sqlStr2 = "select 状态 as 状态1,sum(数量)as 数量1,sum(金额)as 金额合计 from 点单历史表 where 点单历史表.单据号='" + Trim(main_czgl_njzfx.Adodc1.Recordset.Fields("结账单据号")) + "'group by 状态"
Call FunAdo(Adodc4, sqlStr2)
Adodc4.Refresh
If Adodc4.Recordset.RecordCount > 1 Then
Label2(0).Caption = Adodc4.Recordset.Fields(1)
Label2(1).Caption = Format(Adodc4.Recordset.Fields(2), "0.00")
If Adodc4.Recordset.EOF = False Then Adodc4.Recordset.MoveNext
Label2(2).Caption = Adodc4.Recordset.Fields(1)
Label2(3).Caption = Format(Adodc4.Recordset.Fields(2), "0.00")
Else
If Trim(Adodc4.Recordset.Fields("状态1")) = "点单" Then
Label2(0).Caption = Adodc4.Recordset.Fields(1)
Label2(1).Caption = Format(Adodc4.Recordset.Fields(2), "0.00")
Label2(2).Caption = "0"
Label2(3).Caption = "0.00"
Else
Label2(0).Caption = "0"
Label2(1).Caption = "0.00"
Label2(2).Caption = Adodc4.Recordset.Fields(1)
Label2(3).Caption = Format(Adodc4.Recordset.Fields(2), "0.00")
End If
End If
End If
End If
If js.text = "3" Then
sqlStr3 = "select * from 日点单信息表 where 日点单信息表.单据号='" + Trim(main_ysyf_gzgl.Adodc1.Recordset.Fields("单据号")) + "'"
Call FunAdo(Adodc5, sqlStr3)
Adodc5.Refresh
Set DataGrid2.DataSource = Adodc5
If Adodc5.Recordset.RecordCount > 0 Then
rs1.Open "select * from 房间台号信息表 where 房间台号信息表.编号='" + Trim(Adodc5.Recordset.Fields("房台编号")) + "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
Label4(0).Caption = Trim(rs1.Fields("编号")) 'Trim函数去掉字符串前后的(不包含字符串中的空格)的空格
Label4(1).Caption = Trim(rs1.Fields("房台名称"))
Label4(2).Caption = Trim(rs1.Fields("类型说明"))
Label4(3).Caption = Trim(rs1.Fields("部门"))
Label4(4).Caption = Trim(rs1.Fields("服务费"))
Label4(5).Caption = Trim(rs1.Fields("简要说明"))
End If
rs1.Close
Labbh.Caption = Trim(Adodc5.Recordset.Fields("服务员编号"))
Labxm.Caption = Trim(Adodc5.Recordset.Fields("服务员姓名"))
labdjh.Caption = Trim(Adodc5.Recordset.Fields("单据号"))
sqlStr4 = "select 状态 as 状态1,sum(数量)as 数量1,sum(金额)as 金额合计 from 日点单信息表 where 日点单信息表.单据号='" + Trim(main_ysyf_gzgl.Adodc1.Recordset.Fields("单据号")) + "'group by 状态"
Call FunAdo(Adodc6, sqlStr4)
Adodc6.Refresh
If Adodc6.Recordset.RecordCount > 1 Then
Label2(0).Caption = Adodc6.Recordset.Fields(1)
Label2(1).Caption = Format(Adodc6.Recordset.Fields(2), "0.00") '使用Format函数将数据格式为“0.00(金钱格式)”格式
If Adodc4.Recordset.EOF = False Then Adodc6.Recordset.MoveNext
Label2(2).Caption = Adodc6.Recordset.Fields(1)
Label2(3).Caption = Format(Adodc6.Recordset.Fields(2), "0.00")
Else
If Trim(Adodc6.Recordset.Fields("状态1")) = "点单" Then
Label2(0).Caption = Adodc6.Recordset.Fields(1)
Label2(1).Caption = Format(Adodc6.Recordset.Fields(2), "0.00")
Label2(2).Caption = "0"
Label2(3).Caption = "0.00"
Else
Label2(0).Caption = "0"
Label2(1).Caption = "0.00"
Label2(2).Caption = Adodc6.Recordset.Fields(1)
Label2(3).Caption = Format(Adodc6.Recordset.Fields(2), "0.00") '使用Format函数将数据格式为“0.00(金钱格式)”格式
End If
End If
End If
End If
If js.text = "4" Then
sqlStr = "select * from 点单历史表 where 点单历史表.单据号='" + Trim(main_ysyf_lsgzcx.Adodc1.Recordset.Fields("单据号")) + "'"
Call FunAdo(Adodc3, sqlStr)
Adodc3.Refresh
Set DataGrid2.DataSource = Adodc3
If Adodc3.Recordset.RecordCount > 0 Then
rs1.Open "select * from 房间台号信息表 where 房间台号信息表.编号='" + Trim(Adodc3.Recordset.Fields("房台编号")) + "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
Label4(0).Caption = Trim(rs1.Fields("编号"))
Label4(1).Caption = Trim(rs1.Fields("房台名称"))
Label4(2).Caption = Trim(rs1.Fields("类型说明"))
Label4(3).Caption = Trim(rs1.Fields("部门"))
Label4(4).Caption = Trim(rs1.Fields("服务费"))
Label4(5).Caption = Trim(rs1.Fields("简要说明"))
End If
rs1.Close
Labbh.Caption = Trim(Adodc3.Recordset.Fields("服务员编号"))
Labxm.Caption = Trim(Adodc3.Recordset.Fields("服务员姓名"))
labdjh.Caption = Trim(Adodc3.Recordset.Fields("单据号"))
sqlStr = "select 状态 as 状态1,sum(数量)as 数量1,sum(金额)as 金额合计 from 点单历史表 where 点单历史表.单据号='" + Trim(main_ysyf_lsgzcx.Adodc1.Recordset.Fields("单据号")) + "'group by 状态"
Call FunAdo(Adodc4, sqlStr)
Adodc4.Refresh
If Adodc4.Recordset.RecordCount > 1 Then
Label2(0).Caption = Adodc4.Recordset.Fields(1)
Label2(1).Caption = Format(Adodc4.Recordset.Fields(2), "0.00") '使用Format函数将数据格式为“0.00(金钱格式)”格式
If Adodc4.Recordset.EOF = False Then Adodc4.Recordset.MoveNext
Label2(2).Caption = Adodc4.Recordset.Fields(1)
Label2(3).Caption = Format(Adodc4.Recordset.Fields(2), "0.00")
Else
If Trim(Adodc4.Recordset.Fields("状态1")) = "点单" Then
Label2(0).Caption = Adodc4.Recordset.Fields(1)
Label2(1).Caption = Format(Adodc4.Recordset.Fields(2), "0.00")
Label2(2).Caption = "0"
Label2(3).Caption = "0.00"
Else
Label2(0).Caption = "0"
Label2(1).Caption = "0.00"
Label2(2).Caption = Adodc4.Recordset.Fields(1)
Label2(3).Caption = Format(Adodc4.Recordset.Fields(2), "0.00")
End If
End If
End If
End If
Label2(4).Caption = Val(Label2(0).Caption) + Val(Label2(2).Caption)
Label2(5).Caption = Format(Val(Label2(1).Caption) + Val(Label2(3).Caption) + Val(Label4(4).Caption), "0.00")
Exit Sub
err1:
ErrMessageBox "窗口启动过程出错" '出错信息显示
End Sub
Private Sub Form_Unload(Cancel As Integer)
main_czgl_yjzfx.Enabled = True
main_czgl_njzfx.Enabled = True
main_ysyf_gzgl.Enabled = True
main_ysyf_lsgzcx.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -