D
D B Lawson
Guest
I want to print worksheets where the WDate field falls between the date range specified in a dialog form. I've tried these different versions of code on the OnClick event of a print button and can't get any of them to work:
DoCmd.OpenReport stDocName, acViewPreview, "[WDate]" & " Between #" & Me!DateFrom & "# AND #" & Me!DateTo & "#"
DoCmd.OpenReport stDocName, acViewPreview, "[WDate] & Between #" & Format(Me.DateFrom, "dd/mm/yy") & "# And #" & Format(Me.DateTo, "dd/mm/yy") & "#"
And
DoCmd.OpenReport stDocName, acPreview, , "[WDate] Between #" & Me![DateFrom] & "# And #" & Me![DateTo] & "#"
They are all compiling OK but I either get all the worksheets or one with Error#
There are reasons why I don't want to use criteria in a query to create the filter.
Any ideas?
Thanks
DoCmd.OpenReport stDocName, acViewPreview, "[WDate]" & " Between #" & Me!DateFrom & "# AND #" & Me!DateTo & "#"
DoCmd.OpenReport stDocName, acViewPreview, "[WDate] & Between #" & Format(Me.DateFrom, "dd/mm/yy") & "# And #" & Format(Me.DateTo, "dd/mm/yy") & "#"
And
DoCmd.OpenReport stDocName, acPreview, , "[WDate] Between #" & Me![DateFrom] & "# And #" & Me![DateTo] & "#"
They are all compiling OK but I either get all the worksheets or one with Error#
There are reasons why I don't want to use criteria in a query to create the filter.
Any ideas?
Thanks