📄 frmcostedit.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FrmCostEdit
BorderStyle = 1 'Fixed Single
Caption = "编辑合同费用"
ClientHeight = 4350
ClientLeft = 45
ClientTop = 345
ClientWidth = 6495
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4350
ScaleWidth = 6495
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 3375
Left = 240
TabIndex = 9
Top = 120
Width = 6015
Begin MSComCtl2.DTPicker DTDate
Height = 270
Left = 4320
TabIndex = 20
Top = 1673
Width = 1455
_ExtentX = 2566
_ExtentY = 476
_Version = 393216
Format = 24903681
CurrentDate = 38696
End
Begin VB.TextBox txtCashier
Height = 270
Left = 1320
MaxLength = 50
TabIndex = 5
Top = 1665
Width = 1455
End
Begin VB.ComboBox ComboDetail
Height = 300
ItemData = "FrmCostEdit.frx":0000
Left = 4320
List = "FrmCostEdit.frx":0013
TabIndex = 2
Text = "Combo1"
Top = 750
Width = 1455
End
Begin VB.TextBox txtReceive
Height = 270
Left = 4320
MaxLength = 100
TabIndex = 4
Top = 1215
Width = 1455
End
Begin VB.TextBox txtAmount
Height = 270
Left = 1320
MaxLength = 50
TabIndex = 3
Top = 1215
Width = 1455
End
Begin VB.TextBox txtCostId
Height = 270
Left = 4320
MaxLength = 20
TabIndex = 0
Top = 315
Width = 1455
End
Begin VB.ComboBox ComboType
Height = 300
ItemData = "FrmCostEdit.frx":0041
Left = 1320
List = "FrmCostEdit.frx":004E
Style = 2 'Dropdown List
TabIndex = 1
Top = 750
Width = 1455
End
Begin VB.TextBox txtMemo
Height = 1095
Left = 1320
MaxLength = 100
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 6
Top = 2160
Width = 4455
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "发生日期"
Height = 180
Left = 3240
TabIndex = 19
Top = 1710
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "经办人"
Height = 180
Left = 240
TabIndex = 18
Top = 1710
Width = 540
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "合同编号"
Height = 180
Left = 240
TabIndex = 17
Top = 360
Width = 720
End
Begin VB.Label lblContractId
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "lblContractId"
Height = 180
Left = 1320
TabIndex = 16
Top = 360
Width = 1170
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "凭单号"
Height = 180
Left = 3240
TabIndex = 15
Top = 360
Width = 540
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "费用明细"
Height = 180
Left = 3240
TabIndex = 14
Top = 810
Width = 720
End
Begin VB.Label Label11
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "费用金额"
Height = 180
Left = 240
TabIndex = 13
Top = 1260
Width = 720
End
Begin VB.Label Label13
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "费用类别"
Height = 180
Left = 240
TabIndex = 12
Top = 810
Width = 720
End
Begin VB.Label Label15
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "收款人"
Height = 180
Left = 3240
TabIndex = 11
Top = 1260
Width = 540
End
Begin VB.Label Lable16
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "备注"
Height = 180
Left = 240
TabIndex = 10
Top = 2160
Width = 360
End
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Default = -1 'True
Height = 400
Left = 1817
MouseIcon = "FrmCostEdit.frx":006E
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 7
Top = 3720
Width = 1300
End
Begin VB.CommandButton Cmd_Cancel
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 3377
MouseIcon = "FrmCostEdit.frx":0378
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 8
Top = 3720
Width = 1300
End
End
Attribute VB_Name = "FrmCostEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriId As String
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
Dim TmpId As String
If Trim(txtCostId) = "" Then
MsgBox "请输入凭单号"
txtCostId.SetFocus
Exit Sub
End If
If Val(txtAmount) < 0 Then
MsgBox "费用应大于0"
txtAmount.SetFocus
Exit Sub
End If
If Trim(txtReceive) = "" Then
MsgBox "请输入收款人"
txtReceive.SetFocus
Exit Sub
End If
If Trim(txtCashier) = "" Then
MsgBox "请输入经办人"
txtCashier.SetFocus
Exit Sub
End If
TmpId = TrimStr(txtCostId.Text)
'判断凭单号是否已经存在
If Modify = False Or OriId <> TmpId Then
If MyCost.In_DB(TmpId) = True Then
MsgBox "凭单号 - " + TmpId + " - 已经存在,请重新输入"
txtCostId.SetFocus
Exit Sub
End If
End If
With MyCost
.ContractId = MyContract.ContractId
.CostId = MakeStr(txtCostId)
.CostType = ComboType.Text
If ComboDetail.Visible = True Then
.Detail = MakeStr(ComboDetail.Text)
Else
.Detail = ""
End If
.Amount = Val(txtAmount)
.Receiver = MakeStr(txtReceive)
.Cashier = MakeStr(txtCashier)
.CostDate = Format(DTDate.Value, "yyyy-mm-dd")
.Memo = MakeStr(txtMemo)
If Modify = False Then
.Insert
Else
Call .Update(OriId)
End If
End With
Unload Me
End Sub
Private Sub ComboType_Click()
If ComboType.ListIndex = 2 Then
ComboDetail.Visible = True
ComboDetail.Text = "火车票"
Label10.Visible = True
Else
ComboDetail.Visible = False
Label10.Visible = False
End If
End Sub
Private Sub txtAmount_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
End Sub
Private Sub txtCashier_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtCostId_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtReceive_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -