📄 addfixed.frm
字号:
VERSION 5.00
Begin VB.Form AddFixed
Caption = "AddFixed"
ClientHeight = 5565
ClientLeft = 6210
ClientTop = 3540
ClientWidth = 6870
LinkTopic = "Form1"
ScaleHeight = 5565
ScaleWidth = 6870
Begin VB.Frame Frame1
Caption = "固定资产添加"
Height = 4335
Left = 0
TabIndex = 2
Top = 0
Width = 6855
Begin VB.TextBox txtID
Appearance = 0 'Flat
Height = 270
Left = 240
TabIndex = 8
Top = 600
Width = 1815
End
Begin VB.TextBox txtName
Appearance = 0 'Flat
Height = 270
Left = 2520
TabIndex = 7
Top = 600
Width = 1815
End
Begin VB.TextBox txtNum
Appearance = 0 'Flat
Height = 270
Left = 4800
TabIndex = 6
Top = 600
Width = 1815
End
Begin VB.TextBox txtMoney
Appearance = 0 'Flat
Height = 270
Left = 240
TabIndex = 5
Top = 1440
Width = 1815
End
Begin VB.TextBox txtMark
Appearance = 0 'Flat
Height = 1695
Left = 240
MaxLength = 100
TabIndex = 4
Top = 2280
Width = 6375
End
Begin VB.TextBox txtBy
Appearance = 0 'Flat
Height = 270
Left = 2520
TabIndex = 3
Top = 1440
Width = 1815
End
Begin VB.Label Label1
Caption = "资产编号"
Height = 255
Left = 240
TabIndex = 14
Top = 360
Width = 1575
End
Begin VB.Label Label2
Caption = "资产名称"
Height = 255
Left = 2520
TabIndex = 13
Top = 360
Width = 1575
End
Begin VB.Label Label3
Caption = "资产数目"
Height = 255
Left = 4800
TabIndex = 12
Top = 360
Width = 1335
End
Begin VB.Label Label4
Caption = "单价(元)"
Height = 255
Left = 240
TabIndex = 11
Top = 1200
Width = 1335
End
Begin VB.Label Label8
Caption = "资产说明"
Height = 255
Left = 240
TabIndex = 10
Top = 2040
Width = 2055
End
Begin VB.Label Label9
Caption = "经手人ID"
Height = 255
Left = 2520
TabIndex = 9
Top = 1200
Width = 1335
End
End
Begin VB.Frame Frame2
Height = 975
Left = 0
TabIndex = 0
Top = 4440
Width = 6855
Begin VB.CommandButton Command2
Caption = "关 闭"
Default = -1 'True
Height = 495
Left = 3240
TabIndex = 15
Top = 240
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 495
Left = 1920
TabIndex = 1
Top = 240
Width = 1095
End
End
End
Attribute VB_Name = "AddFixed"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If txtID.Text = "" Then '判断资产编号输入框不为空
MsgBox "资产编号不能为空!", vbCritical
txtID.SetFocus
Exit Sub
End If
If txtName.Text = "" Then '判断资产名称输入框不为空
MsgBox "资产名称不能为空!", vbCritical
txtName.SetFocus
Exit Sub
End If
If txtNum.Text = "" Then '判断资产数目输入框不为空
MsgBox "资产数目不能为空!", vbCritical
txtNum.SetFocus
Exit Sub
End If
If txtMoney.Text = "" Then '判断资产单价输入框不为空
MsgBox "资产单价不能为空!", vbCritical
txtMoney.SetFocus
Exit Sub
End If
If txtBy.Text = "" Then '判断经手人ID输入框不为空
MsgBox "经手人ID不能为空!", vbCritical
txtBy.SetFocus
Exit Sub
End If
If txtMark.Text = "" Then '判断资产说明输入框不为空
MsgBox "资产说明不能为空!", vbCritical
txtMark.SetFocus
Exit Sub
End If
If Not IsNumeric(txtNum.Text) Then '判断资产数目输入框必须是数字
MsgBox "资产数目必须是数字!", vbCritical
txtNum.SetFocus
Exit Sub
End If
If Not IsNumeric(txtMoney.Text) Then '判断资产单价输入框是数字
MsgBox "资产单价必须是数字!", vbCritical
txtMoney.SetFocus
Exit Sub
End If
Dim strSql As String
' strSql = "update tb_zichan set zcID = " & txtID.Text & ",zcName = " & txtName.Text & ",zcNum =" & txtNum.Text & ",zcMoney = " & txtMoney.Text & ",zcBy = " & txtBy.Text & ",zcMark = " & txtMark.Text & ""
strSql = "insert into tb_zichan (zcID,zcName,zcNum,zcMoney,zcBy,zcMark) values('" & txtID.Text & "','" & txtName.Text & "'," & txtNum.Text & "," & txtMoney.Text & ",'" & txtBy.Text & "','" & txtMark.Text & "')"
Set rst = ExecuteSql(strSql)
MsgBox "添加资产信息成功!", vbOKOnly + vbExclamation, "HKJSJ052201H"
'txtMark.Text = strSql
End Sub
Private Sub Command2_Click()
Me.Hide
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -