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

📄 frmmodifysalary.frm

📁 该系统是用VB开发的一个人事管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Top             =   1680
         Width           =   855
      End
      Begin VB.Label Label2 
         Caption         =   "姓名:"
         Height          =   375
         Left            =   360
         TabIndex        =   4
         Top             =   1080
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "员工号:"
         Height          =   375
         Left            =   360
         TabIndex        =   3
         Top             =   480
         Width           =   855
      End
   End
   Begin VB.Frame Frame2 
      BackColor       =   &H00C0E0FF&
      Caption         =   "修改员工工资信息"
      Height          =   1215
      Left            =   120
      TabIndex        =   1
      Top             =   7320
      Width           =   7935
      Begin VB.CommandButton cancelCommand 
         Caption         =   "关闭退出"
         Height          =   495
         Left            =   6120
         TabIndex        =   45
         Top             =   360
         Width           =   1455
      End
      Begin VB.CommandButton deleteCommand 
         Caption         =   "删除记录"
         Height          =   495
         Left            =   4200
         TabIndex        =   44
         Top             =   360
         Width           =   1575
      End
      Begin VB.CommandButton updateCommand 
         Caption         =   "保存记录"
         Height          =   495
         Left            =   2280
         TabIndex        =   43
         Top             =   360
         Width           =   1575
      End
      Begin VB.CommandButton editCommand 
         Caption         =   "修改记录"
         Height          =   495
         Left            =   360
         TabIndex        =   42
         Top             =   360
         Width           =   1575
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00FFC0C0&
      Caption         =   "查看员工工资信息"
      Height          =   1455
      Left            =   120
      TabIndex        =   0
      Top             =   5640
      Width           =   7935
      Begin VB.CommandButton lastCommand 
         Caption         =   "最后一条记录"
         Height          =   495
         Left            =   6120
         TabIndex        =   41
         Top             =   480
         Width           =   1455
      End
      Begin VB.CommandButton nextCommand 
         Caption         =   "下一条记录"
         Height          =   495
         Left            =   4200
         TabIndex        =   40
         Top             =   480
         Width           =   1575
      End
      Begin VB.CommandButton previousCommand 
         Caption         =   "上一条记录"
         Height          =   495
         Left            =   2280
         TabIndex        =   39
         Top             =   480
         Width           =   1575
      End
      Begin VB.CommandButton firstCommand 
         Caption         =   "第一条记录"
         Height          =   495
         Left            =   360
         TabIndex        =   38
         Top             =   480
         Width           =   1575
      End
   End
End
Attribute VB_Name = "frmModifySalary"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim myBookmark As Variant
Dim mcclean As Boolean
Dim mn As ADODB.Recordset

Private Sub cancelCommand_Click()
Unload Me
End Sub

Private Sub deleteCommand_Click()
If MsgBox("是否删除当前记录?", vbOKCancel, "删除当前记录") = vbOK Then
        mn.Delete
        mn.MoveFirst
        Call viewData
    Else
        Call viewData
    End If
End Sub

Private Sub editCommand_Click()
Frame1.Enabled = False
    firstCommand.Enabled = False
    previousCommand.Enabled = False
    nextCommand.Enabled = False
    lastCommand.Enabled = False
    'Dim i As Integer
    txtEmployeeID.Enabled = False
    txtEmployeeName.Enabled = True
    txtdixin.Enabled = True
    txtbutie.Enabled = True
    txtjiangjin.Enabled = True
    txtjiaban.Enabled = True
    txtkoukaohe.Enabled = True
    txtyanglao.Enabled = True
    txtyiliao.Enabled = True
    txtzhufang.Enabled = True
    txtshuiqian.Enabled = True
    txtsuodeshui.Enabled = True
    txtfangwu.Enabled = True
    txtchelv.Enabled = True
    txtshifa.Enabled = True
    DTPicker1.Enabled = True
    
End Sub

Private Sub firstCommand_Click()
mn.MoveFirst
Call viewData
End Sub

Private Sub Form_Load()
Dim txtSQL As String
    Dim MsgText As String
    
    txtSQL = "select * from 员工工资信息表"
    Set mn = ExecuteSQL(txtSQL, MsgText)
    mn.MoveFirst
    Call viewData
    '显示记录信息
    '下面的代码设置记录为只读
    txtEmployeeID.Enabled = False
    txtEmployeeName.Enabled = False
    txtdixin.Enabled = False
    txtbutie.Enabled = False
    txtjiangjin.Enabled = False
    txtjiaban.Enabled = False
    txtkoukaohe.Enabled = False
    txtyanglao.Enabled = False
    txtyiliao.Enabled = False
    txtzhufang.Enabled = False
    txtshuiqian.Enabled = False
    txtsuodeshui.Enabled = False
    txtfangwu.Enabled = False
    txtchelv.Enabled = False
    txtshifa.Enabled = False
    DTPicker1.Enabled = False
End Sub
Public Sub viewData()
    txtEmployeeID.Text = mn.Fields(0)
    txtEmployeeName.Text = mn.Fields(1)
    txtdixin.Text = mn.Fields(2)
    txtbutie.Text = mn.Fields(3)
    txtjiangjin.Text = mn.Fields(4)
    txtjiaban.Text = mn.Fields(5)
    txtkoukaohe.Text = mn.Fields(6)
    txtyanglao.Text = mn.Fields(7)
    txtyiliao.Text = mn.Fields(8)
    txtzhufang.Text = mn.Fields(9)
    txtshuiqian.Text = mn.Fields(10)
    txtsuodeshui.Text = mn.Fields(11)
    txtfangwu.Text = mn.Fields(12)
    txtchelv.Text = mn.Fields(13)
    txtshifa.Text = mn.Fields(14)
    DTPicker1.Value = mn.Fields(15)
    
End Sub

Private Sub lastCommand_Click()
mn.MoveLast
Call viewData
End Sub

Private Sub nextCommand_Click()
mn.MoveNext
If mn.EOF Then
   mn.MoveFirst
   End If
   Call viewData
End Sub

Private Sub previousCommand_Click()
mn.MovePrevious
If mn.BOF Then
   mn.MoveLast
   End If
   Call viewData
End Sub

Private Sub updateCommand_Click()
mn.Fields(0) = txtEmployeeID.Text
    mn.Fields(1) = txtEmployeeName.Text
    mn.Fields(2) = txtdixin.Text
    mn.Fields(3) = txtbutie.Text
    mn.Fields(4) = txtjiangjin.Text
    mn.Fields(5) = txtjiaban.Text
    mn.Fields(6) = txtkoukaohe.Text
    mn.Fields(7) = txtyanglao.Text
    mn.Fields(8) = txtyiliao.Text
    mn.Fields(9) = txtzhufang.Text
    mn.Fields(10) = txtshuiqian.Text
    mn.Fields(11) = txtsuodeshui.Text
    mn.Fields(12) = txtfangwu.Text
    mn.Fields(13) = txtchelv.Text
    mn.Fields(14) = txtshifa.Text
    mn.Fields(15) = DTPicker1.Value
    mn.Update
    MsgBox "员工工资信息更新成功!!", vbOKOnly + vbExclamation, "更新员工工资信息"
    Call viewData
    Frame1.Enabled = True
    firstCommand.Enabled = True
    previousCommand.Enabled = True
    nextCommand.Enabled = True
    lastCommand.Enabled = True
    'Dim i As Integer
    txtEmployeeID.Enabled = False
    txtEmployeeName.Enabled = False
    txtdixin.Enabled = False
    txtbutie.Enabled = False
    txtjiangjin.Enabled = False
    txtjiaban.Enabled = False
    txtkoukaohe.Enabled = False
    txtyanglao.Enabled = False
    txtyiliao.Enabled = False
    txtzhufang.Enabled = False
    txtshuiqian.Enabled = False
    txtsuodeshui.Enabled = False
    txtfangwu.Enabled = False
    txtchelv.Enabled = False
    txtshifa.Enabled = False
    DTPicker1.Enabled = False
End Sub

⌨️ 快捷键说明

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