Date Filters VBA

Status
Not open for further replies.

Neilster

Registered User.
Local time
Today, 14:35
Joined
Jan 19, 2014
Messages
218
I know in Access that you can filter your work load criteria for each employee which is fine using Como boxes to filter down specific criteria for that employee, however I'm trying to achieve it with date filters between certain dates, and it works but ends up filtering the dates for every employee, I just want it to filter that specific employee .

This is what I have so far.

PHP:
 Private Sub Date_Filter_Click()
 
    Dim strWhere As String
    Dim lngLen As Long
    Const conJetDate = "\#mm\/dd\/yyyy\#"
    
   
    If Not IsNull(Me.txtStartDate) Then
        strWhere = strWhere & " ([NextCallDate] >= " & Format(Me.txtStartDate, conJetDate) & ") AND "
    End If
    
    
    If Not IsNull(Me.txtEndDate) Then
        strWhere = strWhere & " ([NextCallDate] < " & Format(Me.txtEndDate + 1, conJetDate) & ") AND "
    End If
    
 
    lngLen = Len(strWhere) - 5
    If lngLen <= 0 Then
        MsgBox "No criteria", vbInformation, "Nothing to do."
    Else
        strWhere = Left$(strWhere, lngLen)
        
        Me.Filter = strWhere
        Me.FilterOn = True
 
    End If
 
End Sub
Can anyone help please :D:D:D
 
Please do not open new threads on the same subject.
 
Status
Not open for further replies.

Users who are viewing this thread

Back
Top Bottom