Code:
Dim strWhere As String
Dim lngLen As Long
If Me.txtPCRNmbr & "" <> "" Then
strWhere = strWhere & "([PCRNmbr] Like '*" & Me.txtPCRNmbr & "*') And "
End If
If Me.cboPrrty & "" <> "" Then
strWhere = strWhere & "([Prrty] Like '" & Me.cboPrrty & "') And "
End If
If Me.cboCADCtgry & "" <> "" Then
strWhere = strWhere & "([CtgryCAD] Like '" & Me.cboCADCtgry & "') And "
End If
If Me.cboRqstr & "" <> "" Then
strWhere = strWhere & "([Rqstd] Like '" & Me.cboRqstr & "') And "
End If
If Me.cboCADStts & "" <> "" Then
strWhere = strWhere & "([CADStts] Like '" & Me.cboCADStts & "') And "
End If
If Me.txtDys & "" <> "" Then
strWhere = strWhere & "([DysOpn] Like '*" & Me.txtDys & "*') And "
End If
If Me.txtNts & "" <> "" Then
strWhere = strWhere & "([Nt] Like '*" & Me.txtNts & "*') And "
End If
If Me.txtDscrptn & "" <> "" Then
strWhere = strWhere & "([Chng] Like '*" & Me.txtDscrptn & "*') And "
End If
If Me.cboPrcss & "" <> "" Then
strWhere = strWhere & "([SttsPrcss] Like '" & Me.cboPrcss & "') And "
End If
If Me.txtDtStrt & "" <> "" Then
strWhere = strWhere & "([DtQA] >= #" & Me.txtDtStrt & "#) AND "
End If
If Me.txtDtEnd & "" <> "" Then
strWhere = strWhere & "([DtEnd] < #" & Me.txtDtEnd & "#) AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "Duuuude. Like, you didn't even enter filter criteria. Did someone thump your noggin? Enter some words already so I can do my job and get back to the waves.", vbInformation, "Whasuuup, Brah?"
Else
strWhere = Left$(strWhere, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
End If
A record has DtQA of 5/13/2015 and DtEnd of 5/21/2015.
Criteria entered is:
DtQA >= 5/12/2015 AND DtEnd < 4/9/2015
That record would not be retrieved. Is that what you would expect?
I just noticed a record with DtEnd that is earlier than DtQA for -15 days - is that valid? What is DtQA for?