📄 form4.frm
字号:
End
Begin VB.TextBox 备注
DataField = "备注"
DataSource = "Adodc1"
Height = 855
Left = 1200
MultiLine = -1 'True
TabIndex = 3
Top = 4440
Width = 4575
End
Begin VB.Label Label10
Caption = "检定周期"
Height = 255
Left = 240
TabIndex = 19
Top = 3840
Width = 855
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "序 号"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 18
Top = 360
Width = 720
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "仪表编号"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 17
Top = 2280
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "所属设备"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 16
Top = 1800
Width = 720
End
Begin VB.Label Label8
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "仪表名称"
Height = 180
Left = 240
TabIndex = 15
Top = 840
Width = 720
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "分 类"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 14
Top = 2760
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "量 程"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 13
Top = 3240
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "上次检定时间"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 120
TabIndex = 12
Top = 1320
Width = 1080
End
Begin VB.Label Label7
Caption = "备 注"
Height = 180
Left = 240
TabIndex = 11
Top = 4440
Width = 720
End
Begin VB.Label Label9
Caption = "下次检定时间"
Height = 180
Left = 2880
TabIndex = 10
Top = 1320
Width = 1080
End
End
Begin VB.CommandButton Cmd_Cancel
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 5760
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 1
Top = 5880
Width = 1300
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Default = -1 'True
Height = 400
Left = 5880
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 0
Top = 6360
Width = 945
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean '插入=false,修改=true
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
'检查用户录入的数据的有效性
If Len(Trim(序号)) = 0 Then
MsgBox "请输入序号"
序号.SetFocus
序号.SelStart = 0
序号.SelLength = Len(序号)
Exit Sub
End If
' 把用户录入的数据复制到数据库对象中
With MyEmp
.序号 = MakeStr(序号) '输入序号
.仪表名称 = MakeStr(仪表名称) '输入仪表名称
.上次检定日期 = MakeStr(上次检定日期) '输入上次检定日期
.下次检定日期 = MakeStr(下次检定日期) '输入下次检定日期
.所属设备 = MakeStr(所属设备) '输入所属设备
.仪表编号 = MakeStr(仪表名称) '输入仪表名称
.分类 = MakeStr(分类) '输入分类
.量程 = MakeStr(量程) '输入量程
.检定周期 = MakeStr(检定周期) '输入检定周期
.备注 = MakeStr(备注) '输入备注
'根据变量Modify的值,决定是插入新数据,还是修改已有的数据
If Modify = False Then
.Insert
Cmd_OK.Enabled = False
Else
Call .Update(OriId)
End If
End With
MsgBox "保存成功"
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -