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

📄 frm_edit_dep.frm

📁 人力资源系统 人员的录入 添加 修改 方便用于各种企业对人员进行管理
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Frm_edit_Dep 
   Caption         =   "修改删除部门信息"
   ClientHeight    =   5070
   ClientLeft      =   60
   ClientTop       =   375
   ClientWidth     =   6060
   LinkTopic       =   "Form2"
   ScaleHeight     =   5070
   ScaleWidth      =   6060
   StartUpPosition =   3  '窗口缺省
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   495
      Left            =   1320
      Top             =   4560
      Width           =   2415
      _ExtentX        =   4260
      _ExtentY        =   873
      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         =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=renli"
      OLEDBString     =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=renli"
      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.Frame Frame3 
      Caption         =   "修改部门信息"
      Height          =   975
      Left            =   480
      TabIndex        =   12
      Top             =   3240
      Width           =   5055
      Begin VB.CommandButton Command7 
         Caption         =   "退出"
         Height          =   375
         Left            =   3360
         TabIndex        =   15
         Top             =   360
         Width           =   1095
      End
      Begin VB.CommandButton Cmd_del 
         Caption         =   "删除记录"
         Height          =   375
         Left            =   1800
         TabIndex        =   14
         Top             =   360
         Width           =   1095
      End
      Begin VB.CommandButton Cmd_modi 
         Caption         =   "修改记录"
         Height          =   375
         Left            =   120
         TabIndex        =   13
         Top             =   360
         Width           =   1095
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "查看部门信息"
      Height          =   975
      Left            =   480
      TabIndex        =   7
      Top             =   2040
      Width           =   5055
      Begin VB.CommandButton Cmd_final 
         Caption         =   "最后一条记录"
         Height          =   375
         Left            =   3720
         TabIndex        =   11
         Top             =   360
         Width           =   1215
      End
      Begin VB.CommandButton Cmd_next 
         Caption         =   "下一条记录"
         Height          =   375
         Left            =   2520
         TabIndex        =   10
         Top             =   360
         Width           =   1095
      End
      Begin VB.CommandButton Cmd_pre 
         Caption         =   "前一条记录"
         Height          =   375
         Left            =   1320
         TabIndex        =   9
         Top             =   360
         Width           =   1095
      End
      Begin VB.CommandButton Cmd_first 
         Caption         =   "第一条记录"
         Height          =   375
         Left            =   120
         TabIndex        =   8
         Top             =   360
         Width           =   1095
      End
   End
   Begin VB.Frame Frame1 
      Height          =   1575
      Left            =   600
      TabIndex        =   0
      Top             =   240
      Width           =   4695
      Begin VB.TextBox txtuppid 
         Height          =   270
         Left            =   1320
         TabIndex        =   6
         Top             =   1080
         Width           =   1095
      End
      Begin VB.TextBox txtDepart_Name 
         Height          =   270
         Left            =   1320
         TabIndex        =   4
         Top             =   720
         Width           =   1095
      End
      Begin VB.TextBox txtDepart_Id 
         Height          =   270
         Left            =   1320
         TabIndex        =   2
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label3 
         Caption         =   "部门领导"
         Height          =   255
         Left            =   360
         TabIndex        =   5
         Top             =   1080
         Width           =   735
      End
      Begin VB.Label Label2 
         Caption         =   "部门名称"
         Height          =   255
         Left            =   360
         TabIndex        =   3
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "部门编号"
         Height          =   375
         Left            =   360
         TabIndex        =   1
         Top             =   360
         Width           =   855
      End
   End
End
Attribute VB_Name = "Frm_edit_Dep"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_del_Click()
 Adodcl.Recordset.Delete
  Adodcl.Recordset.Update
  MsgBox ("部门记录已删除")
  Adodcl.RecordSource = "select * from Depart"
Adodcl.Refresh
  
End Sub

Private Sub Cmd_final_Click()
Adodcl.Recordset.MoveLast
 Cmd_next.Enabled = False
Cmd_pre.Enabled = True
End Sub

Private Sub Cmd_first_Click()
 Adodcl.Recordset.MoveFirst
 Cmd_pre.Enabled = False
Cmd_next.Enabled = True
End Sub

Private Sub Cmd_modi_Click()
curId = Adodcl.Recordset.Fields(0)

Adodcl.Recordset.Fields(1) = Val(Trim(txtDepart_Id.Text))
Adodcl.Recordset.Fields(2) = Trim(txtDepart_Name.Text)
Adodcl.Recordset.Fields(3) = Trim(txtuppid.Text)


Adodcl.Recordset.Update
MsgBox ("部门记录已修改")

Adodcl.RecordSource = "select * from Depart"
Adodcl.Refresh


Do While Adodcl.Recordset.Fields(0) <> curId
   Adodcl.Recordset.Move (1)
   Loop
End Sub

Private Sub Cmd_next_Click()
If Cmd_pre.Enabled = False Then
   Cmd_pre.Enabled = True
   End If
    Adodcl.Recordset.MoveNext
    If Adodcl.Recordset.Fields(0) = lastId Then
   Cmd_next.Enabled = False
End If
End Sub

Private Sub Cmd_pre_Click()
If Cmd_next.Enabled = False Then
   Cmd_next.Enabled = True
   End If
   Adodcl.Recordset.MovePrevious
If Adodcl.Recordset.Fields(0) = firstId Then
   Cmd_pre.Enabled = False
End If
End Sub



Private Sub Command7_Click()
Load FormMain
FormMain.Show
Me.Hide
End Sub

Private Sub Form_Load()

Adodcl.RecordSource = "select * from Depart"
Adodcl.Refresh
If Adodcl.Recordset.RecordCount <> 0 Then
  Adodcl.Recordset.MoveLast
  lastId = Adodcl.Recordset.Fields(0)
  Adodcl.Recordset.MoveFirst
  firstId = Adodcl.Recordset.Fields(0)
  End If
  
  Cmd_pre.Enabled = False
  If Adodcl.Recordset.RecordCount <> 1 Then
   Cmd_next.Enabled = False
   End If
End Sub

⌨️ 快捷键说明

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