Link to home
Start Free TrialLog in
Avatar of M A
M AFlag for United States of America

asked on

filter report based on dates

I followed the below link to filter the report based on dates selected in the textbox
https://www.experts-exchange.com/questions/28050231/Modify-button-code-to-obtain-report-date-ranges-from-text-box's-on-form.html

It is not getting filtered it is showing the entire report. below is my code.

Textbox names
Shipment_Date_From
Shipment_Date_To
Field name in table is "Shipment_Date"

DoCmd.OpenReport "ShipmentReport_datewise", acViewPreview, "", "([Shipment_date]>=#" & Format(Forms!Reporting!Shipment_Date_From, "dd-mm-yyyy") & "#) And ([Shipment_date]<=#" & Format(Forms!Reporting!Shipment_Date_To, "dd-mmm-yyyy") & "# )"


Can anyone help to sort out this
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the above presumes the field is date.
if it's text, with the format dd-mm-yyyy you cannot use >= and <= directly ...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of M A

ASKER

Thanks it worked with mm-dd-yyyy
 I appreciate if you can guide how to make it landscape.
As of now it is opening in portrait
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of M A

ASKER

Many thanks