?? 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 + -