?? f_zhaopin.frm
字號:
Begin VB.Label lblLabels
Caption = "招聘日期:"
Height = 255
Index = 0
Left = 360
TabIndex = 15
Top = 1200
Width = 975
End
Begin VB.Label lblLabels
Caption = "招聘方式:"
Height = 255
Index = 1
Left = 3840
TabIndex = 14
Top = 1080
Width = 855
End
Begin VB.Label lblLabels
Caption = "崗位編號:"
Height = 255
Index = 2
Left = 360
TabIndex = 13
Top = 2640
Width = 855
End
Begin VB.Label lblLabels
Caption = "崗位名稱:"
Height = 255
Index = 3
Left = 3840
TabIndex = 12
Top = 1920
Width = 855
End
Begin VB.Label lblLabels
Caption = "所屬部門:"
Height = 255
Index = 4
Left = 360
TabIndex = 11
Top = 1920
Width = 975
End
Begin VB.Label lblLabels
Caption = "應聘人數:"
Height = 255
Index = 5
Left = 3840
TabIndex = 10
Top = 2520
Width = 735
End
Begin VB.Label lblLabels
Caption = "招聘費:"
Height = 255
Index = 6
Left = 360
TabIndex = 9
Top = 3240
Width = 975
End
Begin VB.Label lblLabels
Caption = "人均費用:"
Height = 255
Index = 7
Left = 3840
TabIndex = 8
Top = 3240
Width = 1095
End
End
End
End
End
Attribute VB_Name = "F_ZhaoPin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim WithEvents adoPrimaryRS As Recordset
Attribute adoPrimaryRS.VB_VarHelpID = -1
Dim mvBookMark As Variant
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
Private Sub Combo1_Click()
Dim sql2 As String
Combo2.Clear
sql2 = "select distinct 崗位名稱 from 崗位說明 where 所屬部門 = '" & Combo1.Text & "'"
Set rs2 = db.Execute(sql2)
While Not rs2.EOF
Combo2.AddItem Trim(rs2("崗位名稱"))
rs2.MoveNext
Wend
End Sub
Private Sub Combo2_Click()
Dim Sql3 As String
Sql3 = "select distinct 崗位編號 from 崗位說明 where 崗位名稱 = '" & Combo2.Text & "'"
Set rs3 = db.Execute(Sql3)
If Not IsNull(rs3("崗位編號")) Then
txtFields(2).Text = Trim(rs3("崗位編號"))
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
For Each TextBox In Me.Controls
TextBox.Font.Name = "宋體"
TextBox.Font.Size = 9
Next
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select * from 招聘登記", db, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = adoPrimaryRS
SetButtons True
Set DTPicker1.DataSource = adoPrimaryRS
Dim oText As TextBox
'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next
Set Combo1.DataSource = adoPrimaryRS
Set Combo2.DataSource = adoPrimaryRS
Dim SqlBuMen As String
SqlBuMen = "select distinct 部門名稱 from 部門維護表"
Set RsBuMen = db.Execute(SqlBuMen)
While Not RsBuMen.EOF
Combo1.AddItem Trim(RsBuMen("部門名稱"))
RsBuMen.MoveNext
Wend
End Sub
Private Sub Form_Unload(Cancel As Integer)
Screen.MousePointer = vbDefault
End Sub
Private Sub cmdAdd_Click()
On Error GoTo AddErr
With adoPrimaryRS
If Not (.BOF And .EOF) Then
mvBookMark = .Bookmark
End If
.AddNew
mbAddNewFlag = True
SetButtons False
End With
Exit Sub
AddErr:
MsgBox "增加操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With adoPrimaryRS
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox "刪除操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdRefresh_Click()
'This is only needed for multi user apps
On Error GoTo RefreshErr
adoPrimaryRS.Requery
Exit Sub
RefreshErr:
MsgBox "刷新操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdEdit_Click()
On Error GoTo EditErr
mbEditFlag = True
SetButtons False
Exit Sub
EditErr:
MsgBox "更改操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdCancel_Click()
' On Error Resume Next
On Error GoTo CancelErr
mbEditFlag = False
mbAddNewFlag = False
adoPrimaryRS.CancelUpdate
If mvBookMark > 0 Then
adoPrimaryRS.Bookmark = mvBookMark
Else
adoPrimaryRS.MoveFirst
End If
SetButtons True
Exit Sub
CancelErr:
MsgBox "取消操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo UpdateErr
adoPrimaryRS.UpdateBatch adAffectAll
If mbAddNewFlag Then
adoPrimaryRS.MoveLast 'move to the new record
End If
mbEditFlag = False
mbAddNewFlag = False
SetButtons True
Exit Sub
UpdateErr:
MsgBox "保存操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdClose_Click()
RSGL.Enabled = True
Unload Me
End Sub
Private Sub SetButtons(bVal As Boolean)
cmdAdd.Visible = bVal
cmdEdit.Visible = bVal
cmdUpdate.Visible = Not bVal
cmdCancel.Visible = Not bVal
cmdDelete.Visible = bVal
cmdClose.Visible = bVal
cmdRefresh.Visible = bVal
If bVal Then
Set DataGrid1.DataSource = adoPrimaryRS
Else
Set DataGrid1.DataSource = Nothing
End If
txtFields(0).Enabled = Not bVal
txtFields(1).Enabled = Not bVal
txtFields(5).Enabled = Not bVal
txtFields(6).Enabled = Not bVal
Combo1.Enabled = Not bVal
Combo2.Enabled = Not bVal
DTPicker1.Enabled = Not bVal
End Sub
Private Sub txtFields_Change(Index As Integer)
If IsNumeric(txtFields(5).Text) And IsNumeric(txtFields(6).Text) Then
txtFields(7) = CDbl(txtFields(6)) / CDbl(txtFields(5))
End If
End Sub
Private Sub txtFields_LostFocus(Index As Integer)
If Not IsNumeric(txtFields(5).Text) And (txtFields(5).Text <> "") Then
MsgBox "請在“應聘人數”中輸入數字", vbExclamation + vbOKOnly, pTitle
txtFields(5).SetFocus
txtFields(5).SelLength = Len(txtFields(5))
txtFields(5).SelStart = 0
End If
If Not IsNumeric(txtFields(6).Text) And (txtFields(6).Text <> "") Then
MsgBox "請在“招聘費”中輸入數字", vbExclamation + vbOKOnly, pTitle
txtFields(6).SetFocus
txtFields(6).SelLength = Len(txtFields(6))
txtFields(6).SelStart = 0
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -