Hello,
I am trying to pass two date parameters into a query in order to view a range of information in a report. The code below is what I am currently working with.
If IsDate(txtStartDate.Text) Then StartDate = "'#'" & txtStartDate.Text & "'#'"
If IsDate(txtEndDate.Text) Then EndDate = "'#'" & txtEndDate.Text & "'#'"
FilterString = FilterString & "SearchDateReceived >= " & StartDate
FilterString & " and "
FilterString = FilterString & "SearchDateReceived <= " & EndDate
DoCmd.OpenReport sTarget, acViewPreview, , FilterString
There are no runtime errors. It opens up the report but with no records. Am I passing the date parameters correctly??
thanks,
Scott
I am trying to pass two date parameters into a query in order to view a range of information in a report. The code below is what I am currently working with.
If IsDate(txtStartDate.Text) Then StartDate = "'#'" & txtStartDate.Text & "'#'"
If IsDate(txtEndDate.Text) Then EndDate = "'#'" & txtEndDate.Text & "'#'"
FilterString = FilterString & "SearchDateReceived >= " & StartDate
FilterString & " and "
FilterString = FilterString & "SearchDateReceived <= " & EndDate
DoCmd.OpenReport sTarget, acViewPreview, , FilterString
There are no runtime errors. It opens up the report but with no records. Am I passing the date parameters correctly??
thanks,
Scott