⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f_jibenxinxi.frm

📁 用Visual basic6开发的人事信息管理系统,数据库采用的是Sql Server2000
💻 FRM
📖 第 1 页 / 共 5 页
字号:
               TabIndex        =   68
               Top             =   300
               Width           =   615
            End
         End
      End
   End
End
Attribute VB_Name = "F_JiBenXinXi"
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
Dim SqlBuMen As String

Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub Combo2_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub Combo3_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub Combo4_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub Combo5_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub Combo6_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub Combo7_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker10_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker11_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub


Private Sub DTPicker12_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker13_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub


Private Sub DTPicker14_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker2_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker3_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker4_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker5_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker6_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker7_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker8_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub DTPicker9_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
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
  Set DTPicker2.DataSource = adoPrimaryRS
  Set DTPicker3.DataSource = adoPrimaryRS
  Set DTPicker4.DataSource = adoPrimaryRS
  Set DTPicker5.DataSource = adoPrimaryRS
  Set DTPicker6.DataSource = adoPrimaryRS
  Set DTPicker7.DataSource = adoPrimaryRS
  Set DTPicker8.DataSource = adoPrimaryRS
  Set DTPicker9.DataSource = adoPrimaryRS
  Set DTPicker10.DataSource = adoPrimaryRS
  Set DTPicker11.DataSource = adoPrimaryRS
  Set DTPicker12.DataSource = adoPrimaryRS
  Set DTPicker13.DataSource = adoPrimaryRS
  Set DTPicker14.DataSource = adoPrimaryRS
  Set Combo1.DataSource = adoPrimaryRS
  Set Combo2.DataSource = adoPrimaryRS
  Set Combo3.DataSource = adoPrimaryRS
  Set Combo4.DataSource = adoPrimaryRS
  Set Combo5.DataSource = adoPrimaryRS
  Set Combo6.DataSource = adoPrimaryRS
  Set Combo7.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
  
 SqlBuMen = "select  distinct 部门名称 from 部门维护表"
  Set RsBuMen = db.Execute(SqlBuMen)
   
  While Not RsBuMen.EOF
     Combo1.AddItem Trim(RsBuMen("部门名称"))
    RsBuMen.MoveNext

  Wend

Combo2.AddItem "正式工"
Combo2.AddItem "临时工"
Combo2.AddItem "聘退人员"

Combo3.AddItem "博士"
Combo3.AddItem "硕士"
Combo3.AddItem "大学"
Combo3.AddItem "大专"
Combo3.AddItem "高中"
Combo3.AddItem "职高"
Combo3.AddItem "中技"
Combo3.AddItem "初中"

Combo4.AddItem "男"
Combo4.AddItem "女"
Combo5.AddItem "男"
Combo5.AddItem "女"

Combo6.AddItem "从农村招收"
Combo6.AddItem "从城镇招收"
Combo6.AddItem "复员转业军人"
Combo6.AddItem "大学中专技校毕业生"
Combo6.AddItem "本市外单位调入"
Combo6.AddItem "外省自治区直辖市调入"
Combo6.AddItem "其他"

Combo7.AddItem "工人和学徒"
Combo7.AddItem "工程技术人员"
Combo7.AddItem "管理人员"
Combo7.AddItem "服务人员"
Combo7.AddItem "其他人员"
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
  On Error GoTo 0
  Exit Sub
AddErr:
  MsgBox "增加操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub

Private Sub cmdDelete_Click()
  On Error GoTo DeleteErr
  If MsgBox("是否确认删除员工信息?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  With adoPrimaryRS
    .Delete
    .MoveNext
    If .EOF Then .MoveLast
  End With
  On Error GoTo 0
  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
  On Error GoTo 0
  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
  If MsgBox("是否确认此操作?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  adoPrimaryRS.UpdateBatch adAffectAll

  If mbAddNewFlag Then
    adoPrimaryRS.MoveLast              'move to the new record
  End If

  mbEditFlag = False
  mbAddNewFlag = False
  SetButtons True
  
  On Error GoTo 0
  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)
Dim oTEX As TextBox
  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
  
  For Each oText In Me.txtFields
     oText.Enabled = Not bVal
  Next
  
  DTPicker1.Enabled = Not bVal
  DTPicker2.Enabled = Not bVal
  DTPicker3.Enabled = Not bVal
  DTPicker4.Enabled = Not bVal
  DTPicker5.Enabled = Not bVal
  DTPicker6.Enabled = Not bVal
  DTPicker7.Enabled = Not bVal
  DTPicker8.Enabled = Not bVal
  DTPicker9.Enabled = Not bVal
  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -