📄 addpform.frm
字号:
VERSION 5.00
Begin VB.Form AddPForm
Caption = "添加职位"
ClientHeight = 3645
ClientLeft = 6375
ClientTop = 4740
ClientWidth = 4260
LinkTopic = "Form1"
ScaleHeight = 3645
ScaleWidth = 4260
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 375
Left = 2400
TabIndex = 7
Top = 3000
Width = 1095
End
Begin VB.CommandButton cmdAdd
Caption = "添加"
Height = 375
Left = 720
TabIndex = 6
Top = 3000
Width = 1215
End
Begin VB.TextBox txtValue
Height = 375
Index = 2
Left = 1560
TabIndex = 5
Top = 1520
Width = 2415
End
Begin VB.TextBox txtValue
Height = 375
Index = 1
Left = 1560
TabIndex = 3
Top = 820
Width = 2415
End
Begin VB.TextBox txtValue
Height = 375
Index = 0
Left = 1560
TabIndex = 1
Top = 120
Width = 2415
End
Begin VB.Label lblField
Caption = "lblField"
Height = 375
Index = 2
Left = 360
TabIndex = 4
Top = 1605
Width = 855
End
Begin VB.Label lblField
Caption = "lblField"
Height = 375
Index = 1
Left = 360
TabIndex = 2
Top = 915
Width = 855
End
Begin VB.Label lblField
Caption = "lblField"
Height = 375
Index = 0
Left = 360
TabIndex = 0
Top = 240
Width = 855
End
End
Attribute VB_Name = "AddPForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'添加职位
Private Sub cmdAdd_Click()
'打开错误处理陷阱
Dim intErrFileNo As Integer '自由文件号
On Error GoTo ErrGoto
'----------------------------------------------------
'生成SQL语句
SQL = "INSERT INTO 职位(职位,基本工资,津贴) VALUES("""
SQL = SQL & txtValue(0).Text & ""","
SQL = SQL & txtValue(1).Text & ","
SQL = SQL & txtValue(2).Text & ")"
'打开数据连接
OpenDBFile
'执行SQL语句
gCon.Execute SQL
'关闭数据连接
CloseDBFile
'刷新数据
PosForm.Adodc1.Refresh
Me.Hide
'----------------------------------------------------
Exit Sub
'-----------------------------
ErrGoto:
'把错误信息保存在文件里
intErrFileNo = FreeFile()
Open "YFSystem.ini" For Append As intErrFileNo
Print #intErrFileNo, Chr(34) + Format(Now, "YYYY-MM-DD HH:MM:SS") + Chr(34), Chr(34) + "信息" + Chr(34), Chr(34) + Err.Description + Chr(34), Chr(34) + "Command1_Click(AddEForm)" + Chr(34), Chr(34) + App.Title + Chr(34)
Close #intErrFileNo
Me.Hide
End Sub
Private Sub cmdCancel_Click()
Me.Hide
End Sub
Private Sub Form_Activate()
lblField(0).Caption = "职位"
lblField(1).Caption = "基本工资"
lblField(2).Caption = "津贴"
For i = 0 To 2
txtValue(i).Text = ""
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -