need help on a connector.
I have a form that filters the report prior to preview. With the current code, it replaces what has been valued first when both filters are valued.
Can someone point out the direction of how this can be done or what I am doing wrong?
current code:
revising the code I tried Nz and If NOT isNull (see below)
Thank you
I have a form that filters the report prior to preview. With the current code, it replaces what has been valued first when both filters are valued.
Can someone point out the direction of how this can be done or what I am doing wrong?
current code:
Code:
stDoc = cboReport
If Me.Category <> "" Then var = "Category = '" & Me.Category & "'"
If Me.Build<> "" Then var = "Build = '" & Me.Entity & "'"
If Me.DueDateFrom <> "" Then var = "Projects.[DueDate] = #" & Me.DueDateFrom & "#"
DoCmd.OpenReport stDoc, acViewPreview, , var
revising the code I tried Nz and If NOT isNull (see below)
Code:
' If Status
If Nz(Me.Status) <> "" Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "Projects.Status = '" & Me.Status & "'"
End If
' If Project
If Nz(Me.Project) <> "" Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "Projects.Project = '" & Me.Project & "'"
End If
' If Due Date From
If IsDate(Me.DueDateFrom) Then
' Add it to the predicate - exact
strWhere = strWhere & " AND " & "Projects.[Due Date] >= " & GetDateFilter(Me.DueDateFrom)
ElseIf Nz(Me.DueDateFrom) <> "" Then
strError = cInvalidDateError
End If
If strError <> "" Then
MsgBox "Please verify your Search Criteria"
Else
'DoCmd.OpenReport stDoc, acViewPreview, , var
End If
Thank you