main_kfgl_xmset.frm

来自「星级酒店客房管理系统一套很不错的系统」· FRM 代码 · 共 1,348 行 · 第 1/4 页

FRM
1,348
字号
        Adodc1.Recordset.Fields("编码") = Me.Text1(4).Text
        End If
        Adodc1.Recordset.Fields("名称") = Me.Text1(9).Text
        If Me.Option4.Value Then
            Adodc1.Recordset.Fields("首选项") = "是"
        Else
            Adodc1.Recordset.Fields("首选项") = ""
        End If
        Adodc1.Recordset.Update
    End Select
    Me.Picture3.Visible = False
End Sub

Private Sub Command7_Click()
    Select Case Save_Type
    Case "增加"
        Adodc1.Recordset.AddNew
        Adodc1.Recordset.Fields("日期") = System_Date
        Adodc1.Recordset.Fields("部门") = Me.Combo3.Text
        Adodc1.Recordset.Fields("编码") = Me.Text1(10).Text
        Adodc1.Recordset.Fields("名称") = Me.Text1(8).Text
        Adodc1.Recordset.Fields("当日发生额") = CCur(Me.Text1(11).Text)
        Adodc1.Recordset.Fields("现金") = CCur(Me.Text1(12).Text)
        Adodc1.Recordset.Fields("信用卡") = CCur(Me.Text1(13).Text)
        Adodc1.Recordset.Fields("挂帐") = CCur(Me.Text1(14).Text)
        Adodc1.Recordset.Fields("操作员") = CzyName
        Adodc1.Recordset.Update
    Case "更改"
        Adodc1.Recordset.Fields("日期") = System_Date
        Adodc1.Recordset.Fields("部门") = Me.Combo3.Text
        Adodc1.Recordset.Fields("编码") = Me.Text1(10).Text
        Adodc1.Recordset.Fields("名称") = Me.Text1(8).Text
        Adodc1.Recordset.Fields("当日发生额") = CCur(Me.Text1(11).Text)
        Adodc1.Recordset.Fields("现金") = CCur(Me.Text1(12).Text)
        Adodc1.Recordset.Fields("信用卡") = CCur(Me.Text1(13).Text)
        Adodc1.Recordset.Fields("挂帐") = CCur(Me.Text1(14).Text)
        Adodc1.Recordset.Fields("操作员") = CzyName
        Adodc1.Recordset.Update
    End Select

    Me.Picture4.Visible = False

End Sub

Private Sub Command8_Click()
    Me.Picture4.Visible = False
End Sub

Private Sub Command9_Click(Index As Integer)
    Select Case Index
        Case Is = 0
            Unload Me
        Case Is = 1
            Save_Type = "增加"
                Text1(4).Text = ""
                Text1(9).Text = ""
                
                Label6.Caption = "  说明:编码样式为: " & Table_SetType & "01,或直接输入:01"
            Select Case Table_SetType
                Case "会计科目"
                    Me.Picture1.Visible = True
                Case "部门"
                    Text1(7).Text = ""
                    Text1(2).Text = ""
                    Text1(6).Text = ""
                    Text1(3).Text = ""
                    Me.Picture2.Visible = True
                Case "ZJ"
                    
                    Me.Picture3.Visible = True
                Case "QZ"
                    Me.Picture3.Visible = True
                Case "BZ"
                    Me.Picture3.Visible = True
                Case "KA"
                    Me.Picture3.Visible = True
                Case "WF"
                    Me.Picture3.Visible = True
                Case "SY"
                    Me.Picture3.Visible = True
                Case "GJ"
                    Me.Picture3.Visible = True
                Case "FL"
                    Me.Picture3.Visible = True
                Case "FF"
                    Me.Picture3.Visible = True
                Case "XL"
                    Me.Picture3.Visible = True
                Case "营业收款"
                    Text1(10).Text = ""
                    Text1(8).Text = ""
                    Text1(11).Text = ""
                    Text1(12).Text = ""
                    Text1(13).Text = ""
                    Text1(14).Text = ""
                    Me.Text1(15).Text = System_Date
                    Me.Picture4.Visible = True
            End Select
        Case Is = 2
            If MsgBox("您确认要删除 {" & Adodc1.Recordset(1) & "}科目吗?", 49, "提示") = vbOK Then
                Adodc1.Recordset.Delete
                Adodc1.Recordset.Update
                Adodc1.Recordset.MoveFirst
            End If
        Case Is = 3
            Save_Type = "更改"
            Select Case Table_SetType
                Case "会计科目"
                    Me.Picture1.Visible = True
                    Me.Text1(0).Text = IIf(IsNull(Adodc1.Recordset.Fields("编码")), "", Adodc1.Recordset.Fields("编码"))
                    Me.Text1(1).Text = IIf(IsNull(Adodc1.Recordset.Fields("名称")), "", Adodc1.Recordset.Fields("名称"))
                    Me.Combo1.Text = IIf(IsNull(Adodc1.Recordset.Fields("类别")), "", Adodc1.Recordset.Fields("类别"))
                    If Adodc1.Recordset.Fields("借贷方") = "借方" Then
                        Me.Option1.Value = True
                    End If
                    If Adodc1.Recordset.Fields("借贷方") = "贷方" Then
                        Me.Option2.Value = True
                    End If
                    Me.Combo2.Text = IIf(IsNull(Adodc1.Recordset.Fields("部门")), "", Adodc1.Recordset.Fields("部门"))
                Case "部门"
                    Text1(7).Text = Adodc1.Recordset("编码")
                    Text1(2).Text = Adodc1.Recordset("部门")
                    Text1(6).Text = Adodc1.Recordset("电话")
                    Text1(3).Text = Adodc1.Recordset("负责人")
                    Me.Picture2.Visible = True
                Case "ZJ"
                    Text1(4).Text = Adodc1.Recordset("编码")
                    Text1(9).Text = Adodc1.Recordset("名称")
                    Me.Picture3.Visible = True
                Case "SY"
                    Text1(4).Text = Adodc1.Recordset("编码")
                    Text1(9).Text = Adodc1.Recordset("名称")
                    Me.Picture3.Visible = True
                Case "GJ"
                    Text1(4).Text = Adodc1.Recordset("编码")
                    Text1(9).Text = Adodc1.Recordset("名称")
                    Me.Picture3.Visible = True
                Case "KA"
                    Text1(4).Text = Adodc1.Recordset("编码")
                    Text1(9).Text = Adodc1.Recordset("名称")
                    Me.Picture3.Visible = True
                Case "WF"
                    Text1(4).Text = Adodc1.Recordset("编码")
                    Text1(9).Text = Adodc1.Recordset("名称")
                    Me.Picture3.Visible = True
                Case "QZ"
                    Text1(4).Text = Adodc1.Recordset("编码")
                    Text1(9).Text = Adodc1.Recordset("名称")
                    Me.Picture3.Visible = True
                Case "FL"
                    Text1(4).Text = Adodc1.Recordset("编码")
                    Text1(9).Text = Adodc1.Recordset("名称")
                    Me.Picture3.Visible = True
                 Case "XL"
                    Text1(4).Text = Adodc1.Recordset("编码")
                    Text1(9).Text = Adodc1.Recordset("名称")
                    Me.Picture3.Visible = True
                Case "BZ"
                    Me.Picture3.Visible = True
                    Me.Text1(4).Text = Adodc1.Recordset.Fields("编码")
                    Me.Text1(9).Text = Adodc1.Recordset.Fields("名称")
                    If Adodc1.Recordset.Fields("首选项") = "是" Then
                        Me.Option4.Value = True
                    Else
                        Me.Option4.Value = False
                    End If
                Case "营业收款"
                    Combo3.Text = Adodc1.Recordset("部门")
                    Text1(10).Text = Adodc1.Recordset("编码")
                    Text1(8).Text = Adodc1.Recordset("名称")
                    Text1(11).Text = Adodc1.Recordset("当日发生额")
                    Text1(12).Text = Adodc1.Recordset("现金")
                    Text1(13).Text = Adodc1.Recordset("信用卡")
                    Text1(14).Text = Adodc1.Recordset("挂帐")
                    Me.Text1(15).Text = System_Date
                    Me.Picture4.Visible = True
            End Select
    End Select
End Sub

Private Sub Form_Load()

'费用项目
    Select Case Table_SetType
    Case "会计科目"
    Adodc1.ConnectionString = My_PROVIDER
    Adodc1.CommandType = adCmdText
    Adodc1.RecordSource = "select * from 项目编码 where 编码 like 'KMLB%' order by 名称"
    Adodc1.Refresh
    While Not Adodc1.Recordset.EOF
        Me.Combo1.AddItem Adodc1.Recordset.Fields("名称")
        If Adodc1.Recordset.Fields("首选项") = "是" Then
            Me.Combo1.Text = Adodc1.Recordset.Fields("名称")
        End If
        Adodc1.Recordset.MoveNext
    Wend
    Adodc1.Recordset.Close
    
    Adodc1.ConnectionString = My_PROVIDER
    Adodc1.CommandType = adCmdText
    Adodc1.RecordSource = "select * from 部门"
    Adodc1.Refresh
    While Not Adodc1.Recordset.EOF
        Me.Combo2.AddItem Adodc1.Recordset.Fields("部门")
        Adodc1.Recordset.MoveNext
    Wend
    Adodc1.Recordset.Close
    
    Adodc1.ConnectionString = My_PROVIDER
    Adodc1.CommandType = adCmdText
    Adodc1.RecordSource = "select * from 费用编号 order by 编码"
    Adodc1.Refresh
    Set DataGrid1.DataSource = Adodc1
    DataGrid1.ReBind
    DataGrid1.Refresh
'部门
    Case "部门"
    Adodc1.ConnectionString = My_PROVIDER
    Adodc1.CommandType = adCmdText
    Adodc1.RecordSource = "select * from 部门 order by 编码"
    Adodc1.Refresh
    Set DataGrid1.DataSource = Adodc1
    DataGrid1.ReBind
    DataGrid1.Refresh
    
    Case Is = "ZJ"
        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select 编码,名称,首选项 from 项目编码 where 编码 like '" & Table_SetType & "%' order by 编码"
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.ReBind
        DataGrid1.Refresh
    Case Is = "QZ"
        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select 编码,名称,首选项 from 项目编码 where 编码 like '" & Table_SetType & "%' order by 编码"
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.ReBind
        DataGrid1.Refresh
    Case Is = "SY"
        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select 编码,名称,首选项 from 项目编码 where 编码 like '" & Table_SetType & "%' order by 编码"
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.ReBind
        DataGrid1.Refresh
    Case Is = "WF"
        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select 编码,名称,首选项 from 项目编码 where 编码 like '" & Table_SetType & "%' order by 编码"
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.ReBind
        DataGrid1.Refresh
    Case Is = "KA"
        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select 编码,名称,首选项 from 项目编码 where 编码 like '" & Table_SetType & "%' order by 编码"
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.ReBind
        DataGrid1.Refresh
    Case Is = "GJ"
        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select 编码,名称,首选项 from 项目编码 where 编码 like '" & Table_SetType & "%' order by 编码"
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.ReBind
        DataGrid1.Refresh
    Case Is = "BZ"
        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select 编码,名称,首选项 from 项目编码 where 编码 like '" & Table_SetType & "%' order by 编码"
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.ReBind
        DataGrid1.Refresh
    Case Is = "FL"
        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select 编码,名称,首选项 from 项目编码 where 编码 like '" & Table_SetType & "%' order by 编码"
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.ReBind
        DataGrid1.Refresh
    Case Is = "FF"
        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select 编码,名称,首选项 from 项目编码 where 编码 like '" & Table_SetType & "%' order by 编码"
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.ReBind
        DataGrid1.Refresh
    Case Is = "XL"
        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select 编码,名称,首选项 from 项目编码 where 编码 like '" & Table_SetType & "%' order by 编码"
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.ReBind
        DataGrid1.Refresh
    Case Is = "营业收款"
        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select * from 部门"
        Adodc1.Refresh
        While Not Adodc1.Recordset.EOF
            'Me.Combo2.AddItem Adodc1.Recordset.Fields("部门")
            Me.Combo3.AddItem Adodc1.Recordset.Fields("部门")
            Adodc1.Recordset.MoveNext
        Wend
        Adodc1.Recordset.Close

        Adodc1.ConnectionString = My_PROVIDER
        Adodc1.CommandType = adCmdText
        Adodc1.RecordSource = "select * from 日营业点收入表 where 日期 like '" & System_Date & "'"
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.ReBind
        DataGrid1.Refresh

    End Select
    
End Sub

Private Sub Option1_Click()
    jd = "借方"
End Sub

Private Sub Option2_Click()
    jd = "贷方"
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?