📄 form3.frm
字号:
DataSource = "A1"
Height = 270
Index = 0
Left = 960
TabIndex = 7
Top = 240
Width = 1095
End
Begin VB.Label Label1
Caption = "资产型号"
Height = 255
Left = 2280
TabIndex = 41
Top = 1200
Width = 735
End
Begin VB.Label Label19
Caption = "编号"
Height = 255
Left = 360
TabIndex = 38
Top = 1200
Width = 495
End
Begin VB.Label Label18
Caption = "资产来源"
Height = 375
Left = 2880
TabIndex = 33
Top = 1800
Width = 975
End
Begin VB.Label Label17
Caption = "报废年限"
Height = 255
Left = 8520
TabIndex = 32
Top = 1800
Width = 975
End
Begin VB.Label Label16
Caption = "已使用年限"
Height = 255
Left = 2160
TabIndex = 31
Top = 720
Width = 975
End
Begin VB.Label Label15
Caption = "放置地点"
Height = 255
Left = 4560
TabIndex = 30
Top = 720
Width = 735
End
Begin VB.Label Label14
Caption = "使用单位"
Height = 255
Left = 120
TabIndex = 29
Top = 720
Width = 735
End
Begin VB.Label Label13
Caption = "联系电话 "
Height = 255
Left = 9960
TabIndex = 28
Top = 720
Width = 855
End
Begin VB.Label Label12
Caption = "数量(件/套/台)"
Height = 255
Left = 4560
TabIndex = 27
Top = 1200
Width = 1335
End
Begin VB.Label Label11
Caption = "单价(元)"
Height = 255
Left = 9960
TabIndex = 26
Top = 1200
Width = 975
End
Begin VB.Label Label10
Caption = "审核人"
Height = 255
Left = 7440
TabIndex = 25
Top = 360
Width = 855
End
Begin VB.Label Label9
Caption = "使用人"
Height = 255
Left = 7440
TabIndex = 24
Top = 720
Width = 855
End
Begin VB.Label Label8
Caption = "购买日期"
Height = 255
Left = 9960
TabIndex = 23
Top = 240
Width = 975
End
Begin VB.Label Label7
Caption = "国别"
Height = 255
Left = 4680
TabIndex = 22
Top = 240
Width = 495
End
Begin VB.Label Label6
Caption = "制造商"
Height = 255
Left = 2400
TabIndex = 21
Top = 240
Width = 615
End
Begin VB.Label Label5
Caption = "资产名称"
Height = 255
Left = 120
TabIndex = 20
Top = 285
Width = 735
End
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Command1.Caption = "资产登记" Then
r = 1
If A1.Recordset.BOF = True And A1.Recordset.EOF = True Then
Else
A1.Recordset.MoveFirst
End If
For X = 1 To 1
If A1.Recordset.EOF = True Then
A1.Tag = Y
Exit For
Else
A1.Recordset.MoveNext
End If
X = X - 1
r = r + 1
Next X
A1.Recordset.AddNew
Command1.Caption = "登记完毕"
Command3.Enabled = False
Command5.Enabled = False
F1.Visible = True
Else
If t3(0).Text = "" Then
MsgBox "资产名称不能为空!", 16, "出错:"
t3(0).Text = "123"
A1.Recordset.Delete
Command1.Caption = "资产登记"
Form3.Show
Command3.Enabled = True
Command5.Enabled = True
F1.Visible = False
Else
For X = 11 To 13
If Len(Trim(t3(X).Text)) > 200 Then
MsgBox "字符不能超过200个!", 16, "出错:"
Exit Sub
End If
Next X
A1.Recordset.MovePrevious
A1.Recordset.MoveNext
Command1.Caption = "输入新记录"
Command3.Enabled = True
Command5.Enabled = True
F1.Visible = False
End If
End If
End Sub
Private Sub Command3_Click()
If A1.Recordset.EOF = True And A1.Recordset.BOF = True Then
MsgBox "您的数据库中没有记录!", 16, "出错:"
Else
If Command3.Caption = "修改记录" Then
Command3.Caption = "修改完毕"
Command1.Enabled = False
Command5.Enabled = False
F1.Visible = True
F1.Caption = "修改记录:"
Else
If t3(0).Text = "" Then
MsgBox "资产名称不能为空!", 16, "出错:"
Else
For X = 11 To 13
If Len(Trim(t3(X).Text)) > 200 Then
MsgBox "字符不能超过200个!", 16, "出错:"
Exit Sub
End If
Next X
Command3.Caption = "修改记录"
Command1.Enabled = True
Command5.Enabled = True
F1.Visible = False
F1.Caption = "数据输入:"
End If
End If
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Command5_Click()
If A1.Recordset.EOF = True Or A1.Recordset.BOF = True Then
MsgBox "您的数据库中没有记录可以删除!", 16, "出错:"
Else
A1.Recordset.Delete
Y = 1
A1.Recordset.MoveFirst
For X = 1 To 1
If A1.Recordset.EOF = True Then
If A1.Recordset.BOF = True Then
Else
A1.Recordset.MoveFirst
End If
Exit For
Else
A1.Recordset.MoveNext
Y = Y + 1
X = X - 1
End If
Next X
End If
End Sub
Private Sub Command9_Click()
For X = 0 To 6
If A1.Recordset.BOF = True Then
MsgBox "您已经位于第一条记录", 32, "提示:"
A1.Recordset.MoveNext
Exit Sub
Else
A1.Recordset.MovePrevious
End If
Next X
End Sub
Private Sub F3_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub Command8_Click()
Form4.Show
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Command4.Enabled = True Then
Cancel = 0
Else
MsgBox "请编辑完这条记录再退出!", 64, "提示:"
Cancel = 1
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -