📄 frm_caiwu.frm
字号:
VERSION 5.00
Begin VB.Form Frm_Finance
Caption = "财务登记薄"
ClientHeight = 5460
ClientLeft = 3495
ClientTop = 3150
ClientWidth = 10020
Icon = "Frm_caiwu.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 5460
ScaleWidth = 10020
Begin VB.CommandButton Cmd_Ok
Caption = "记入账薄"
Height = 375
Left = 720
TabIndex = 23
Top = 4680
Width = 1935
End
Begin VB.CommandButton Cmd_Cancel
Caption = "取消"
Height = 375
Left = 3120
TabIndex = 22
Top = 4680
Width = 1455
End
Begin VB.Frame Frame2
Caption = "明细"
Height = 3375
Left = 480
TabIndex = 5
Top = 960
Width = 9375
Begin VB.ComboBox Comb_Object
Height = 300
Left = 1080
TabIndex = 24
Text = "Combo1"
Top = 2760
Width = 2895
End
Begin VB.ComboBox Comb_kind
Height = 300
Left = 1080
TabIndex = 20
Text = "Combo4"
Top = 2280
Width = 1455
End
Begin VB.ComboBox Comb_Leader
Height = 300
Left = 1080
TabIndex = 18
Text = "Combo3"
Top = 1800
Width = 1455
End
Begin VB.TextBox Txt_Cause
Height = 270
Left = 1080
TabIndex = 16
Top = 1320
Width = 6975
End
Begin VB.TextBox Txt_BillNum
Height = 270
Left = 3480
TabIndex = 14
Top = 840
Width = 4575
End
Begin VB.ComboBox Comb_way
Height = 300
Left = 1080
TabIndex = 12
Text = "Combo2"
Top = 840
Width = 1215
End
Begin VB.TextBox Txt_Sum
Height = 270
Left = 3000
TabIndex = 9
Text = "0"
Top = 360
Width = 975
End
Begin VB.ComboBox Comb_Direction
Height = 300
Left = 1080
TabIndex = 6
Text = "出入帐"
Top = 360
Width = 975
End
Begin VB.Label Label11
Caption = "交接方:"
Height = 255
Left = 240
TabIndex = 21
Top = 2760
Width = 735
End
Begin VB.Label Label10
Caption = "帐目种类:"
Height = 255
Left = 240
TabIndex = 19
Top = 2280
Width = 855
End
Begin VB.Label Label9
Caption = "批准人:"
Height = 255
Left = 240
TabIndex = 17
Top = 1800
Width = 735
End
Begin VB.Label Label8
Caption = "原因:"
Height = 255
Left = 240
TabIndex = 15
Top = 1320
Width = 735
End
Begin VB.Label Lbl_BillNum
Caption = "支票号:"
Height = 255
Left = 2640
TabIndex = 13
Top = 840
Width = 615
End
Begin VB.Label Label6
Caption = "交易方式"
Height = 255
Left = 240
TabIndex = 11
Top = 840
Width = 855
End
Begin VB.Label Label5
Caption = "元"
Height = 255
Left = 4200
TabIndex = 10
Top = 360
Width = 375
End
Begin VB.Label Label4
Caption = "金额:"
Height = 255
Left = 2280
TabIndex = 8
Top = 360
Width = 495
End
Begin VB.Label Label3
Caption = "出入帐"
Height = 255
Left = 360
TabIndex = 7
Top = 360
Width = 855
End
End
Begin VB.Frame Frame1
Caption = "日期与人员"
Height = 615
Left = 480
TabIndex = 0
Top = 240
Width = 9375
Begin VB.TextBox txt_Operator
Height = 270
Left = 3960
Locked = -1 'True
TabIndex = 4
Top = 240
Width = 1215
End
Begin VB.TextBox Txt_Date
Height = 270
Left = 960
TabIndex = 2
Top = 240
Width = 1695
End
Begin VB.Label Label2
Caption = "操作人员"
Height = 255
Left = 3000
TabIndex = 3
Top = 240
Width = 735
End
Begin VB.Label Label1
Caption = "日期"
Height = 255
Left = 240
TabIndex = 1
Top = 240
Width = 1095
End
End
End
Attribute VB_Name = "Frm_Finance"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rsFiance As Recordset
Dim ctlArray As Object
Dim wksFiance As Workspace
Dim dbFiance As Database
Dim mctlArray() As Control
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_Ok_Click()
If MsgBox("明细无法修改,是否确定记入账薄?", vbQuestion + vbOKCancel, Frm_Finance.Caption) = vbOK Then
Set rsFiance = dbFiance.OpenRecordset("财务登记表", dbOpenTable)
If Comb_Way.Text = "支票" Then Txt_Cause.Text = Txt_Cause.Text & ";支票号为: " & Txt_BillNum.Text
With rsFiance
.AddNew
For i = 1 To .Fields.Count - 2
If .Fields(i).Type = vbCurrency Then
.Fields(i) = CCur(mctlArray(i).Text)
Else
.Fields(i) = mctlArray(i).Text
End If
Next i
.Fields(11) = 0
.Update
.Close
End With
End If
' Set rsFiance = dbFiance.OpenRecordset("财务登记表", dbOpenTable)
' With rsFiance
' .MoveLast
'Call MsgBox("登账ID号为" & CStr(.Fields("ID")), vbOKOnly + vbInformation, STRGARAGE)
' .Close
'End With
Unload Me
End Sub
Private Sub Comb_way_click()
If Comb_Way.Text = "支票" Then
Txt_BillNum.Visible = True
Lbl_BillNum.Visible = True
Else
Txt_BillNum.Visible = False
Lbl_BillNum.Visible = False
End If
End Sub
Private Sub Form_Load()
Frm_Login.Show vbModal
On Error GoTo EHand
If strOkorEsc = "确定" Then
Set wksFiance = DBEngine.CreateWorkspace("Finance", Frm_Login.Txt_Name, Frm_Login.Txt_PWD, dbUseJet)
Set dbFiance = wksFiance.OpenDatabase(DBPATH, False, False)
'加载咯控件:
Comb_Direction.Clear
Comb_Direction.AddItem "支出"
Comb_Direction.AddItem "收入"
Comb_Direction.ListIndex = 0
Comb_Way.Clear
Comb_Way.AddItem "现金"
Comb_Way.AddItem "记帐"
Comb_Way.AddItem "支票"
Comb_Way.AddItem "借款"
Comb_Way.AddItem "贷款"
Comb_Way.ListIndex = 0
Set rsFiance = dbFiance.OpenRecordset("职员表", dbOpenTable)
Do Until rsFiance.EOF
If rsFiance.Fields("工组") = "管理" Then Comb_Leader.AddItem rsFiance.Fields("姓名")
rsFiance.MoveNext
Loop
Comb_Leader.ListIndex = 0
rsFiance.Close
Set rsFiance = dbFiance.OpenRecordset("账目种类表", dbOpenTable)
Do Until rsFiance.EOF
Comb_kind.AddItem rsFiance.Fields("账目种类")
rsFiance.MoveNext
Loop
rsFiance.Close
Comb_kind.ListIndex = 0
Set rsFiance = dbFiance.OpenRecordset("联系人", dbOpenTable)
Comb_Object.AddItem "未填"
Do Until rsFiance.EOF
Comb_Object.AddItem rsFiance.Fields("客户名称")
rsFiance.MoveNext
Loop
rsFiance.Close
Comb_Object.ListIndex = 0
Comb_kind.ListIndex = 0
Txt_Date.Text = Date
txt_Operator.Text = wksFiance.UserName
ReDim mctlArray(11)
Set mctlArray(1) = Txt_Date
Set mctlArray(2) = Comb_Direction
Set mctlArray(4) = Txt_Sum
Set mctlArray(3) = Txt_Sum
Set mctlArray(5) = Comb_Way
Set mctlArray(6) = Txt_Cause
Set mctlArray(7) = txt_Operator
Set mctlArray(8) = Comb_Leader
Set mctlArray(9) = Comb_Object
Set mctlArray(10) = Comb_kind
Lbl_BillNum.Visible = False
Txt_BillNum.Visible = False
Exit Sub
End If
EHand:
If strOkorEsc = "确定" Then MsgBox Err.Description, vbCritical + vbOKOnly, STRGARAGE
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
If strOkorEsc = "确定" Then
'If Not IsNull(dbFiance) Then dbFiance.Close
'wksFiance.Close
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -