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

📄 frmemployeeupdate.frm

📁 很好! 很实用! 免费!
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmEmployeeUpdate 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "编辑员工"
   ClientHeight    =   6975
   ClientLeft      =   2760
   ClientTop       =   3750
   ClientWidth     =   9960
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6975
   ScaleWidth      =   9960
   ShowInTaskbar   =   0   'False
   Begin VB.ComboBox cbLogon 
      Height          =   315
      Left            =   5280
      Style           =   2  'Dropdown List
      TabIndex        =   12
      Top             =   3120
      Width           =   2295
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Height          =   375
      Left            =   6600
      TabIndex        =   6
      Top             =   6360
      Width           =   1095
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   375
      Left            =   7800
      TabIndex        =   5
      Top             =   6360
      Width           =   1095
   End
   Begin VB.TextBox txtNo 
      Height          =   375
      Left            =   1920
      MaxLength       =   10
      TabIndex        =   4
      Top             =   1920
      Width           =   1455
   End
   Begin VB.TextBox txtName 
      Height          =   375
      Left            =   5280
      MaxLength       =   20
      TabIndex        =   3
      Top             =   1920
      Width           =   2295
   End
   Begin VB.TextBox txtLogin 
      Height          =   375
      Left            =   1920
      MaxLength       =   20
      TabIndex        =   2
      Top             =   2520
      Width           =   1455
   End
   Begin VB.TextBox txtDept 
      Height          =   375
      Left            =   5280
      MaxLength       =   20
      TabIndex        =   1
      Top             =   2520
      Width           =   2295
   End
   Begin VB.TextBox txtPassword 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1920
      MaxLength       =   20
      PasswordChar    =   "*"
      TabIndex        =   0
      Top             =   3120
      Width           =   1455
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "系统用户"
      Height          =   195
      Left            =   4440
      TabIndex        =   13
      Top             =   3120
      Width           =   720
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "员工编号"
      Height          =   195
      Left            =   1080
      TabIndex        =   11
      Top             =   1920
      Width           =   720
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "员工名称"
      Height          =   195
      Left            =   4440
      TabIndex        =   10
      Top             =   1920
      Width           =   720
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "登录名"
      Height          =   195
      Left            =   1080
      TabIndex        =   9
      Top             =   2520
      Width           =   540
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "部门"
      Height          =   195
      Left            =   4440
      TabIndex        =   8
      Top             =   2520
      Width           =   360
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "密码"
      Height          =   195
      Left            =   1080
      TabIndex        =   7
      Top             =   3120
      Width           =   360
   End
End
Attribute VB_Name = "frmEmployeeUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit


Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
'编辑员工
Dim sSQL As String
    sSQL = "update  hrEmployee set No=" + CheckString(Trim(txtNo.Text)) + _
            ",Name=" + CheckString(Trim(txtName.Text)) + ",LoginName=" + CheckString(Trim(txtLogin)) + _
            ",Password=" + CheckString(Trim(txtPassword.Text)) + ",Logon=" & CheckString(Me.cbLogon.Text) & "," & _
            "Department=" + CheckString(Trim(txtDept.Text)) + ",OperatorID=" + CheckString(g_sUserID) + _
            ",ModifyDate=getdate() where id=" + CheckString(frmEmployee.ExcelGrid1.DataRecordset.Fields("ID").value)
            g_cn.Execute sSQL
    Unload Me
    frmEmployee.RefreshData
End Sub


Private Sub Form_Load()
    'center the form
    Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
    '写入数据到界面
    Me.txtDept.Text = IIf(IsNull(frmEmployee.ExcelGrid1.DataRecordset.Fields("Department").value), "", frmEmployee.ExcelGrid1.DataRecordset.Fields("Department").value)
    Me.txtLogin.Text = frmEmployee.ExcelGrid1.DataRecordset.Fields("Loginname").value
    Me.txtName.Text = frmEmployee.ExcelGrid1.DataRecordset.Fields("name").value
    Me.txtNo.Text = frmEmployee.ExcelGrid1.DataRecordset.Fields("no").value
    Me.txtPassword = frmEmployee.ExcelGrid1.DataRecordset.Fields("password").value
    cbLogon.AddItem "是"
    cbLogon.AddItem "否"
    Me.cbLogon.Text = frmEmployee.ExcelGrid1.DataRecordset.Fields("logon").value
End Sub

⌨️ 快捷键说明

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