|
将原日期控件删掉
Private Sub Command16_Click()
Dim strCriteria As String
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
If Not IsNull(ctl) Then
Select Case ctl.Name
Case "所在班组"
If ctl <> "车间" Then
strCriteria = strCriteria & ctl.Name & " like '" & ctl _
& "' And "
End If
Case "考勤情况"
If ctl <> "违反劳动纪律" Then
strCriteria = strCriteria & ctl.Name & " like '" & ctl _
& "' And "
Else
strCriteria = strCriteria & ctl.Name & _
" in ('迟到','早退','旷工') And "
End If
Case "日期开始"
strCriteria = strCriteria & "日期>=#" & ctl & "# And "
Case "日期结束"
strCriteria = strCriteria & "日期<=#" & ctl & "# And "
Case Else
strCriteria = strCriteria & ctl.Name & " like '" & ctl & _
"' And "
End Select
End If
End If
Next
If strCriteria <> "" Then
strCriteria = Left(strCriteria, Len(strCriteria) - 5)
End If
Me.考勤管理子窗体.Form.Filter = strCriteria
Me.考勤管理子窗体.Form.FilterOn = True
End Sub |
|