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

📄 frmempfind.frm

📁 一个用VB开发的考勤管理系统... 希望大家来看看..提出见意.. 谢谢.
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Left            =   2970
      TabIndex        =   17
      Top             =   1020
      Width           =   630
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "姓 名:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Index           =   1
      Left            =   300
      TabIndex        =   16
      Top             =   1020
      Width           =   630
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "部 门:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Index           =   9
      Left            =   2970
      TabIndex        =   15
      Top             =   1680
      Width           =   630
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "职 务:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Index           =   4
      Left            =   300
      TabIndex        =   14
      Top             =   2340
      Width           =   630
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "年 龄:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Index           =   3
      Left            =   300
      TabIndex        =   13
      Top             =   1680
      Width           =   630
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "工 号:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Index           =   0
      Left            =   2970
      TabIndex        =   12
      Top             =   345
      Width           =   630
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "备 注:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Index           =   5
      Left            =   300
      TabIndex        =   11
      Top             =   3000
      Width           =   630
   End
End
Attribute VB_Name = "frmEmpFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const mstrAllSex = "所有性别"

Const mstrNoCard = "未发"
Const mstrHasCard = "正常"
Const mstrMissCard = "已挂失"

'***txtEmp
Const mWorkNo = 0
Const mName = 1
Const mAge = 2
Const mNote = 3
Const mSpell = 4

'*****cboEmp
Const mSex = 0
Const mDept = 1
Const mTitle = 2
Const mStatus = 3

Private Sub cboEmp_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        SendKeyTab KeyCode
    End If
End Sub

Private Sub Command1_Click(Index As Integer)
    If Index = 0 Then
        FindEmp
    End If
    Unload Me
End Sub

Private Sub Form_Load()
    With cboEmp(mDept)
        .Clear
        FillCbo cboEmp(mDept), aDepartment, 0
    End With
    With cboEmp(mTitle)
        .Clear
        FillCbo cboEmp(mTitle), aTitle, 0
    End With
    
    With cboEmp(mStatus)
        .AddItem "所有卡态"
        .ItemData(.NewIndex) = gMAXITEM
        .AddItem mstrNoCard
        .ItemData(.NewIndex) = gNoCard
        .AddItem mstrHasCard
        .ItemData(.NewIndex) = gHasCard
        .AddItem mstrMissCard
        .ItemData(.NewIndex) = gMissCard
        .ListIndex = 0
    End With
    
    With cboEmp(mSex)
        '所有性别 男 女
        .AddItem mstrAllSex
        .AddItem "男"
        .AddItem "女"
        If .ListCount > 0 Then .ListIndex = 0
    End With
    
End Sub


Private Sub FindEmp()
    Dim Sql As String
    Dim WhereFlag As Boolean
    Dim Str As String
    Dim TempRst As Recordset
    
    Dim strWorkNo As String
    Dim strSpell As String
    Dim strName As String
    Dim strSex As String
    Dim strAge As String
    Dim intDept As Integer
    Dim intTitle As Integer
    Dim intStatus As Integer
    Dim strNote As String
    
    strSpell = Trim(txtEmp(mSpell))
    strWorkNo = Trim(txtEmp(mWorkNo))
    strName = Trim(txtEmp(mName))
    strSex = Trim(cboEmp(mSex).Text)
    strAge = Trim(txtEmp(mAge))
    strNote = Trim(txtEmp(mNote))
    getItemData cboEmp(mDept), intDept
    getItemData cboEmp(mTitle), intTitle
    getItemData cboEmp(mStatus), intStatus
    
    Sql = " Select WorkNo from Employee "
    
    If strWorkNo <> Empty Then
        Sql = Sql & " where " & "InStr(1,WorkNo,'" & strWorkNo & "',0)>0 "
        WhereFlag = True
    End If
    
    Sql = Sql & JoinSqlStr(strName, WhereFlag, "Name", True)
    Sql = Sql & JoinSqlStr(UCase(strSpell), WhereFlag, "Spell", True)
    If Not isEmpty(strAge) Then Sql = Sql & JoinSqlStr(strAge, WhereFlag, "Age", False)
    If strSex <> mstrAllSex Then Sql = Sql & JoinSqlStr(strSex, WhereFlag, "Sex", True)
    If intDept <> gMAXITEM Then Sql = Sql & JoinSqlStr(intDept, WhereFlag, "DeptID", False)
    If intTitle <> gMAXITEM Then Sql = Sql & JoinSqlStr(intTitle, WhereFlag, "TitleID", False)
    If intStatus <> gMAXITEM Then Sql = Sql & JoinSqlStr(intStatus, WhereFlag, "CardStatus", False)
    Sql = Sql & JoinSqlStr(strNote, WhereFlag, "Note", True)
    
    Sql = Sql & " order  by WorkNo "
    Set TempRst = gDataBase.OpenRecordset(Sql)
'    Dim myFrm As New frmEmploy
'    Set myFrm = New frmEmploy
    If TempRst.RecordCount > 0 Then
        Do While Not TempRst.EOF
            With frmEmploy.mcolWorkno
                .Add Trim(TempRst!WorkNo), Trim(TempRst!WorkNo)
                TempRst.MoveNext
            End With
        Loop
        TempRst.Close
        Unload Me
    Else
        MsgBox "没有符合条件的记录", vbInformation, gTitle
    End If
                
End Sub


'
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 27 Then
        Command1_Click 1
    End If
End Sub

Private Sub txtEmp_GotFocus(Index As Integer)
    GotFocus txtEmp(Index)
End Sub

Private Sub txtEmp_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        SendKeyTab KeyCode
    End If
End Sub

Private Sub txtEmp_KeyPress(Index As Integer, KeyAscii As Integer)
    Select Case Index
        Case mWorkNo, mAge
            KeyAscii = ValiText(KeyAscii, "0123456789", True)
    End Select
End Sub

⌨️ 快捷键说明

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