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

📄 frm_emp_find.frm

📁 一个完整的非接触IC卡会员管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frm_Emp_Find 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "查询"
   ClientHeight    =   3165
   ClientLeft      =   4140
   ClientTop       =   2505
   ClientWidth     =   6810
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   12
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3165
   ScaleWidth      =   6810
   Begin VB.ComboBox ComboDept 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   13.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   4320
      TabIndex        =   9
      Top             =   1200
      Width           =   2172
   End
   Begin VB.ComboBox ComboDiploma 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   13.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   4320
      TabIndex        =   8
      Top             =   720
      Width           =   2172
   End
   Begin VB.ComboBox ComboDuty 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   13.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   4320
      TabIndex        =   7
      Top             =   240
      Width           =   2172
   End
   Begin VB.TextBox txtEmpName 
      Height          =   372
      Left            =   1440
      MaxLength       =   8
      TabIndex        =   6
      Top             =   720
      Width           =   1812
   End
   Begin VB.TextBox txtEmpID 
      Height          =   372
      Left            =   1440
      MaxLength       =   8
      TabIndex        =   5
      Top             =   240
      Width           =   1812
   End
   Begin VB.TextBox txtBirth 
      Height          =   372
      Left            =   1440
      TabIndex        =   4
      Top             =   1200
      Width           =   1812
   End
   Begin VB.TextBox txtDate 
      Height          =   372
      Left            =   1440
      TabIndex        =   3
      Top             =   1680
      Width           =   1812
   End
   Begin VB.CommandButton cmdCencal 
      Caption         =   "取消(&C)"
      Height          =   492
      Left            =   2760
      TabIndex        =   2
      Top             =   2520
      Width           =   1332
   End
   Begin VB.CommandButton cmdFind 
      Caption         =   "确定(&O)"
      Height          =   492
      Left            =   1320
      TabIndex        =   1
      Top             =   2520
      Width           =   1332
   End
   Begin VB.CommandButton cmdClose 
      Caption         =   "关闭(&Q)"
      Enabled         =   0   'False
      Height          =   492
      Left            =   4200
      TabIndex        =   0
      Top             =   2520
      Width           =   1332
   End
   Begin VB.Label Label6 
      Caption         =   "职务:"
      Height          =   492
      Left            =   3600
      TabIndex        =   16
      Top             =   240
      Width           =   972
   End
   Begin VB.Label Label5 
      Caption         =   "聘用时间:"
      Height          =   492
      Left            =   240
      TabIndex        =   15
      Top             =   1680
      Width           =   1212
   End
   Begin VB.Label Label4 
      Caption         =   "出生年月:"
      Height          =   492
      Left            =   240
      TabIndex        =   14
      Top             =   1200
      Width           =   1212
   End
   Begin VB.Label Label2 
      Caption         =   "员工姓名:"
      Height          =   492
      Left            =   240
      TabIndex        =   13
      Top             =   720
      Width           =   1212
   End
   Begin VB.Label Label1 
      Caption         =   "员工编号:"
      Height          =   492
      Left            =   240
      TabIndex        =   12
      Top             =   240
      Width           =   1332
   End
   Begin VB.Label Label7 
      Caption         =   "学历:"
      Height          =   492
      Left            =   3600
      TabIndex        =   11
      Top             =   720
      Width           =   972
   End
   Begin VB.Label Label11 
      Caption         =   "部门:"
      Height          =   492
      Left            =   3600
      TabIndex        =   10
      Top             =   1200
      Width           =   972
   End
End
Attribute VB_Name = "frm_Emp_Find"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Dim pssql As String
Private Sub cmdCencal_Click()
    cmdFind.Enabled = False
    cmdClose.Enabled = True
End Sub

Private Sub cmdClose_Click()
    Unload Me
End Sub

Private Sub cmdFind_Click()
    sWhere = ""
    
    sWhere = sWhere & IIf(Len(Trim(txtEmpID.Text)) = 0, "", " 员工编号= '" & Trim(txtEmpID.Text) & "' and ")
    sWhere = sWhere & IIf(Len(Trim(txtEmpName.Text)) = 0, "", " 员工姓名= '" & Trim(txtEmpName.Text) & "' and ")
    sWhere = sWhere & IIf(Len(Trim(txtBirth.Text)) = 0, "", " 出生年月= '" & txtBirth.Text & "' and ")
    sWhere = sWhere & IIf(Len(Trim(txtDate.Text)) = 0, "", " 进入公司时间= '" & txtDate.Text & "' and ")
    sWhere = sWhere & IIf(Len(Trim(ComboDuty.Text)) = 0, "", " 职务= '" & ComboDuty.Text & "' and ")
    sWhere = sWhere & IIf(Len(Trim(ComboDiploma.Text)) = 0, "", " 学历= '" & ComboDiploma.Text & "' and ")
    sWhere = sWhere & IIf(Len(Trim(ComboDept.Text)) = 0, "", " 部门= '" & ComboDept.Text & "' and ")
    
    If Len(Trim(sWhere)) > 0 Then
       sWhere = Left(sWhere, Len(sWhere) - 4)
       sWhere = " where " & sWhere
    End If
    
    sWhere1 = sWhere
    sWhere = " select *  from 员工信息临时表" & sWhere
    
    cmdFind.Enabled = False
    cmdClose.Enabled = True
    maSys_db.Execute "delete from 员工信息表"
    pssql = "insert into 员工信息表 select 员工编号,员工姓名,员工性别,出生年月,进入公司时间,部门,联系电话,证件编号,联系地址,职务,学历 from 员工信息临时表 " & sWhere1
    maSys_db.Execute pssql
    Unload Me
End Sub
Private Sub ComboDuty_Get()
    Set rs = GetRecordset(maSys_db, "select * from 职务设置表 ")
    If Not rs.EOF Then
          ComboDept.Clear
          Do While Not rs.EOF
             ComboDuty.AddItem Trim(rs!职务名称)
             rs.MoveNext
          Loop
          ComboDuty.Text = ""
    Else
          ComboDept.Clear
          str_Msg = MsgBox("请先增加职务信息!", vbInformation + vbOKOnly, "中芯德立提示信息")
    End If
End Sub
Private Sub ComboDiploma_Get()
    ComboDiploma.AddItem "博士"
    ComboDiploma.AddItem "硕士"
    ComboDiploma.AddItem "大学本科"
    ComboDiploma.AddItem "大学专科"
    ComboDiploma.AddItem "高中"
    ComboDiploma.AddItem "中学"
    ComboDiploma.AddItem "小学"
    ComboDiploma.Text = ""
End Sub

Private Sub ComboFiliale_LostFocus()
    ComboDept_Get
End Sub
Private Sub ComboDept_Get()
    Set rs = GetRecordset(maSys_db, "select * from  dept_dict")
    If Not rs.EOF Then
          ComboDept.Clear
          Do While Not rs.EOF
             ComboDept.AddItem Trim(rs!dept_name)
             rs.MoveNext
          Loop
          ComboDept.Text = ""
    Else
          ComboDept.Clear
          str_Msg = MsgBox("请先增加部门信息!", vbInformation + vbOKOnly, "中芯德立提示信息")
    End If
End Sub
Private Sub Form_Load()
    Me.Top = (Screen.Height - Me.Height) / 2
    Me.Left = (Screen.Width - Me.Width) / 2
    ComboDuty_Get
    ComboDiploma_Get
    
End Sub

Private Sub txtEmpID_KeyPress(KeyAscii As Integer)
If KeyAscii > 57 Or KeyAscii < 48 And KeyAscii <> 8 Then
        KeyAscii = 0
End If
End Sub

Private Sub txtEmpID_LostFocus()
txtEmpID = Format(txtEmpID, "00000000")
End Sub

⌨️ 快捷键说明

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