Hi I have upgraded to Access 2010 and have found a bit of a problem with the following. The Command Button filters according to a text box (text) and two text boxes (date) for start and finish dates
The text filters but the date has no effect at all
Yet in the report data tab - filter this is the result using the command btn
[date_inc] Between #1/09/2011# AND #25/09/2011#
And this is the result using on report built in filter selection "Dates Between"
[date_inc] Between #9/1/2011# And #9/25/2011#
just the US UK date format reversed which should not matter?
Private Sub cmdFilter_Click()
Dim strWhere
If Not IsNull(Me.cboBranch) Then
strWhere = strWhere & "[BranchName]='" & Me.cboBranch & "'"
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 "rptIncListing2", acViewPreview, , strWhere
End Sub
any suggestions please