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

📄 main_rsbd_rsbd.frm

📁 从网络上下载的VB的人事档案管理系统,经过修改.加入了些功能.希望对大家有帮助
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form main_rsbd_rsbd 
   BackColor       =   &H00D0E8EE&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "人事变更信息录入窗口"
   ClientHeight    =   4890
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6495
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4890
   ScaleWidth      =   6495
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton CmdSave 
      BackColor       =   &H00FFC0C0&
      Caption         =   "保存"
      Height          =   390
      Left            =   3090
      Style           =   1  'Graphical
      TabIndex        =   11
      Top             =   4410
      Width           =   1650
   End
   Begin VB.CommandButton CmdEnd 
      BackColor       =   &H00FFC0C0&
      Caption         =   "返回"
      Height          =   390
      Left            =   4785
      Style           =   1  'Graphical
      TabIndex        =   10
      Top             =   4410
      Width           =   1650
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00D0E8EE&
      Height          =   3720
      Left            =   90
      TabIndex        =   0
      Top             =   615
      Width           =   6330
      Begin MSDataListLib.DataCombo DataCombo2 
         Bindings        =   "main_rsbd_rsbd.frx":0000
         Height          =   330
         Left            =   1320
         TabIndex        =   14
         Top             =   2235
         Width           =   4875
         _ExtentX        =   8599
         _ExtentY        =   582
         _Version        =   393216
         ListField       =   "部门名称"
         Text            =   ""
      End
      Begin VB.TextBox Text1 
         Height          =   330
         Index           =   5
         Left            =   1320
         Locked          =   -1  'True
         TabIndex        =   12
         Top             =   1710
         Width           =   4875
      End
      Begin VB.TextBox Text1 
         Height          =   330
         Index           =   7
         Left            =   1320
         TabIndex        =   9
         Top             =   3285
         Width           =   4875
      End
      Begin VB.TextBox Text1 
         Height          =   330
         Index           =   6
         Left            =   1320
         TabIndex        =   8
         Top             =   2775
         Width           =   4875
      End
      Begin VB.TextBox Text1 
         Height          =   330
         Index           =   4
         Left            =   1320
         Locked          =   -1  'True
         TabIndex        =   7
         Top             =   1200
         Width           =   4875
      End
      Begin VB.TextBox Text1 
         Height          =   330
         Index           =   3
         Left            =   4065
         Locked          =   -1  'True
         TabIndex        =   6
         Top             =   690
         Width           =   2115
      End
      Begin MSDataListLib.DataCombo DataCombo1 
         Bindings        =   "main_rsbd_rsbd.frx":0015
         Height          =   330
         Left            =   1110
         TabIndex        =   5
         Top             =   675
         Width           =   1845
         _ExtentX        =   3254
         _ExtentY        =   582
         _Version        =   393216
         ListField       =   "工号"
         Text            =   ""
      End
      Begin MSComCtl2.DTPicker DTP1 
         Height          =   330
         Left            =   1110
         TabIndex        =   4
         Top             =   210
         Width           =   1845
         _ExtentX        =   3254
         _ExtentY        =   582
         _Version        =   393216
         CalendarBackColor=   16777215
         Format          =   64487425
         CurrentDate     =   38125
      End
      Begin VB.Label Label5 
         BackStyle       =   0  'Transparent
         Caption         =   "变动说明:"
         Height          =   315
         Left            =   195
         TabIndex        =   15
         Top             =   3360
         Width           =   975
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "现部门名称:                             现 职 务:"
         ForeColor       =   &H00FF0000&
         Height          =   810
         Left            =   195
         TabIndex        =   13
         Top             =   2310
         Width           =   1170
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "变动日期:"
         Height          =   390
         Left            =   195
         TabIndex        =   3
         Top             =   270
         Width           =   2340
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "原部门名称:                             原 职 务:"
         ForeColor       =   &H000000FF&
         Height          =   810
         Left            =   195
         TabIndex        =   2
         Top             =   1260
         Width           =   1170
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   $"main_rsbd_rsbd.frx":002A
         Height          =   255
         Left            =   195
         TabIndex        =   1
         Top             =   765
         Width           =   4380
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   -945
      Top             =   2100
      Visible         =   0   'False
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   330
      Left            =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   1485
      _ExtentX        =   2619
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Label Label10 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFC0C0&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "   人事变更信息录入"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C000C0&
      Height          =   375
      Left            =   1605
      TabIndex        =   16
      Top             =   150
      Width           =   3300
   End
End
Attribute VB_Name = "main_rsbd_rsbd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Private Sub CmdSave_Click()
  rs1.Open "select * from 人事变动信息表", Cnn, adOpenKeyset, adLockOptimistic
  rs1.AddNew
  rs1.Fields("变动日期") = DTP1.Value
  rs1.Fields("工号") = DataCombo1.Text
  For i = 3 To 5
      rs1.Fields(i) = Text1(i).Text
  Next i
  rs1.Fields("现部门名称") = DataCombo2.Text
  rs1.Fields("现职务") = Text1(6).Text
  rs1.Fields("变动说明") = Text1(7).Text
  rs1.Update
  rs2.Open "select * from 人事档案信息表 where 工号='" + DataCombo1.Text + "'", Cnn, adOpenKeyset, adLockOptimistic
  If rs2.RecordCount > 0 Then
     rs2.Fields("部门名称") = DataCombo2.Text
     rs2.Fields("行政职务") = Text1(6).Text
     rs2.Update
  End If
  main_rsbd.Adodc3.Refresh
  main_rsbd.Adodc1.Refresh
  '关闭数据集对象
  rs1.Close
  rs2.Close
  Unload Me
End Sub
Private Sub DataCombo1_Change()
  rs1.Open "select * from 人事档案信息表 where 工号='" + DataCombo1.Text + "'", Cnn, adOpenKeyset, adLockOptimistic
  If rs1.RecordCount > 0 Then
     Text1(3).Text = rs1.Fields("姓名")
     Text1(4).Text = rs1.Fields("部门名称")
     Text1(5).Text = rs1.Fields("行政职务")
  End If
  rs1.Close
End Sub
Private Sub DataCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyReturn Then DataCombo2.SetFocus
End Sub
Private Sub DataCombo2_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyReturn Then Text1(6).SetFocus
End Sub
Private Sub Form_Activate()
  DTP1.SetFocus
  Adodc1.ConnectionString = Cnn
Adodc1.RecordSource = "select * from 人事档案信息表  where 员工状态='在职'"
Adodc1.Refresh

Adodc2.ConnectionString = Cnn
Adodc2.RecordSource = "select * from 部门信息表"
Adodc2.Refresh
End Sub
Private Sub Form_Load()
  DTP1.Value = Date
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
  If Index < 7 And KeyCode = vbKeyReturn Then Text1(Index + 1).SetFocus
  If Index = 7 And KeyCode = vbKeyReturn Then CmdSave.SetFocus
End Sub
Private Sub DTP1_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyReturn Then DataCombo1.SetFocus
End Sub
Private Sub Form_Unload(Cancel As Integer)
 frm_main.Enabled = True
End Sub
Private Sub CmdEnd_Click()
  Unload Me
End Sub

⌨️ 快捷键说明

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