I found a few problems.
The Sub cmdFilter_Click has an error in the DoCmd.OpenReport line. strWhere is misspelled. If you add this line in the header of every code module, errors in variable spellings will be apparent when you compile the code: Option Explicit
It will also require every variable to be declared so you might not want to implement it in this module. It can be very helpful when writing new procedures.
The Sub cmdFilter_Click() has an incomplete strWhere, missing the EndDate of the date range critieria and the date field name is wrong and is not including the depot criteria (the code is set up for a checkbox, not combobox). Try this revised procedure:
Code:
Private Sub cmdFilter_Click()
Dim strWhere
If Not IsNull(Me.txtDepot) Then
strWhere = strWhere & "[Depot]='" & Me.txtDepot & "'"
End If
If Not IsNull(Me.txtStartDate) Then
strWhere = strWhere & IIf(strWhere = "", "", " AND ") & "[date_inc] Between #" & Me.txtStartDate & "# AND #" & Me.txtEndDate & "#"
End If
DoCmd.OpenReport "Incident Listing Report", acViewPreview, , strWhere
End Sub
The conJetDate was bugging on me. The procedure to clear the controls also bugged so I went with this:
Code:
Private Sub cmdReset_Click()
'Purpose: Clear all the search boxes in the Form Detail, and show all records again.
Me.txtDepot = Null
Me.txtStartDate = Null
Me.txtEndDate = Null
'Remove the form's filter.
Me.FilterOn = False
End Sub
Hope this helps you progress.