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

📄 frmdept3.frm

📁 朋友给的
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form frmDept3 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "员工培训记录"
   ClientHeight    =   6525
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   8640
   LinkTopic       =   "Form3"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   6525
   ScaleWidth      =   8640
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame10 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000008&
      Height          =   5475
      Left            =   2445
      TabIndex        =   2
      Top             =   0
      Width           =   6135
      Begin VB.TextBox Text18 
         Height          =   3990
         Left            =   165
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   6
         Top             =   1380
         Width           =   5775
      End
      Begin VB.TextBox Text19 
         Enabled         =   0   'False
         Height          =   330
         Left            =   1290
         TabIndex        =   5
         Top             =   270
         Width           =   1695
      End
      Begin VB.TextBox Text20 
         Enabled         =   0   'False
         Height          =   330
         Left            =   4140
         TabIndex        =   4
         Top             =   270
         Width           =   1695
      End
      Begin VB.Frame Frame14 
         Height          =   150
         Left            =   120
         TabIndex        =   3
         Top             =   660
         Width           =   5865
      End
      Begin VB.Label Label25 
         Caption         =   "员工培训记录:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   240
         TabIndex        =   9
         Top             =   1050
         Width           =   2100
      End
      Begin VB.Label Label26 
         Caption         =   "工    号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   240
         TabIndex        =   8
         Top             =   330
         Width           =   1185
      End
      Begin VB.Label Label27 
         Caption         =   "姓    名:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   3165
         TabIndex        =   7
         Top             =   330
         Width           =   1185
      End
   End
   Begin VB.Frame Frame16 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000008&
      Height          =   6465
      Left            =   45
      TabIndex        =   0
      Top             =   0
      Width           =   2370
      Begin MSFlexGridLib.MSFlexGrid MSFlexGrid4 
         Height          =   6225
         Left            =   75
         TabIndex        =   1
         Top             =   165
         Width           =   2205
         _ExtentX        =   3889
         _ExtentY        =   10980
         _Version        =   393216
         FixedCols       =   0
         Appearance      =   0
      End
   End
   Begin VB.Frame Frame15 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000008&
      Height          =   1050
      Left            =   2445
      TabIndex        =   10
      Top             =   5415
      Width           =   6135
      Begin VB.CommandButton Command13 
         Caption         =   "保 存(&S)"
         Height          =   510
         Left            =   2910
         TabIndex        =   13
         Top             =   315
         Width           =   1275
      End
      Begin VB.CommandButton Command15 
         Caption         =   "退 出(&E)"
         Height          =   510
         Left            =   4290
         TabIndex        =   12
         Top             =   315
         Width           =   1275
      End
      Begin VB.CommandButton Command16 
         Caption         =   "刷新(&F)"
         Height          =   510
         Left            =   1530
         TabIndex        =   11
         Top             =   315
         Width           =   1275
      End
   End
End
Attribute VB_Name = "frmDept3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strHead As String
Dim strWid  As String

Private Sub Command13_Click()
    Dim rs As New ADODB.Recordset
    If rs.State = 1 Then rs.Close
    rs.Open "select 培训记录 from T_员工表 where 工号='" & Text19.Text & "'", gCnn, adOpenStatic, adLockReadOnly
    If rs.RecordCount > 0 Then
        gCnn.Execute "update T_员工表 set 培训记录='" & Text18.Text & "'  where  工号='" & Text19.Text & "'"
    End If
    If rs.State = 1 Then rs.Close
    MsgBox "保存成功!", vbInformation, "系统提示"
    Call Form_Load
End Sub

Private Sub Command15_Click()
    Unload Me
End Sub

Private Sub Command16_Click()
    Call Form_Load
End Sub

Private Sub Form_Load()

'ID,工号,姓名,性别,出生年月,身份证号,电话,手机,电子邮箱,住址,学历,民族,毕业院校,所学专业,上班日期,职务,职称,部门,员工状态,奖惩记录,培训记录,照片  T_员工表
    Dim rs As New ADODB.Recordset
    If Me.WindowState = 0 Then Me.Move 0, 0
    Call ShowHead1
    If rs.State = 1 Then rs.Close

    MSFlexGrid4.Rows = 1
    
    gSQL = "select 工号,姓名,身份证号,性别,出生年月,电话,手机,电子邮箱,住址,民族,毕业院校,所学专业,上班日期,学历,职务,职称,部门,员工状态 from T_员工表 "
    rs.Open gSQL, gCnn, adOpenStatic, adLockReadOnly
    If rs.RecordCount >= 1 Then
        rs.MoveFirst
        
        Do While Not rs.EOF
        
            MSFlexGrid4.Rows = MSFlexGrid4.Rows + 1
            MSFlexGrid4.Row = MSFlexGrid4.Rows - 1
            MSFlexGrid4.TextMatrix(MSFlexGrid4.Row, 0) = rs.Fields(0).Value
            MSFlexGrid4.TextMatrix(MSFlexGrid4.Row, 1) = rs.Fields(1).Value
            rs.MoveNext
        Loop
        
    End If
    
    gtxtclear

End Sub

Private Sub ShowHead1()
    'MSFlexGrid1设置
    strHead = "工号,姓名"
    strWid = "800,1200"
    FillGridHead MSFlexGrid4, strHead, strWid
    
End Sub

Public Sub gtxtclear()

        Text18 = ""
        Text19 = ""
        Text20 = ""

End Sub

Private Sub MSFlexGrid4_Click()
    Dim rs As New ADODB.Recordset
    If MSFlexGrid4.Rows = 1 Then Exit Sub
    If MSFlexGrid4.TextMatrix(MSFlexGrid4.Row, 1) = "" Then Exit Sub
    Text19.Text = MSFlexGrid4.TextMatrix(MSFlexGrid4.Row, 0)
    Text20.Text = MSFlexGrid4.TextMatrix(MSFlexGrid4.Row, 1)
    If rs.State = 1 Then rs.Close
    rs.Open "select 培训记录 from T_员工表 where 工号='" & Text19.Text & "'", gCnn, adOpenStatic, adLockReadOnly
    If rs.RecordCount > 0 Then
        If IsNull(rs(0)) = False Then
            Text18.Text = rs(0)
        End If
    End If
    If rs.State = 1 Then rs.Close
    
End Sub

⌨️ 快捷键说明

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