I have a button which opens a report and filters the report to show only records between a date range which the user chooses by typing a date into two edit boxes called "start date" and "end date". The VB for the button is:
But when the report opens it shows all records, is there something else i need to do to the report or query it is based on to make the filter / WHERE clause work.
Thanks in advance KRis.
Code:
Dim stDocName As String
Dim stAcView As String
Dim strWhere As String
If [print options] = 1 Then stAcView = acViewNormal Else stAcView = acViewPreview
strWhere = "[Date] Between #" & [start date] & "# And #" & [end date] & "#"
stDocName = [report name]
DoCmd.OpenReport stDocName, stAcView, , strWhere
But when the report opens it shows all records, is there something else i need to do to the report or query it is based on to make the filter / WHERE clause work.
Thanks in advance KRis.