I have a report that is made up of two subreports, and I am trying to set the filter based on a combo box selection and date range. Here is what I have so far:
Code:
Report.[Shipping Without WOTracking].Filter = "WOTracking.ContractCo = '" & Me.cbxShipCO & "' AND WOTracking.Date_Time >= #" & Format(dt1, "yyyy-mm-dd") & "# AND WOTracking.Date_Time <= #" & Format(dt2, "yyyy-mm-dd") & "#;"
Report.[Shipping Without WOTracking].Filter = True
DoCmd.OpenReport "Shipping Without WOTracking", acViewPreview
It is throwing an "Object Required" error on the filter line, but I am not sure why.
The SQL Source for the report returns all records is:
Code:
SELECT Shipping.OrderNo, Shipping.ShipDate, WOTracking.ContractCo
FROM Shipping INNER JOIN WOTracking ON Shipping.[OrderNo] = WOTracking.[OrderNo]
WHERE (((WOTracking.OrderNo) Is Null));
Any assistance would be greatly appreciated.