I've been struggling with this for a while and finally decided I needed some help. I have a report "Order Info" that is filtered by a form filter "OrderFilter".
The filter has fields for OrderFrom, Order To, and txtStart and txtEnd. The report opens based on the information entered in the filter and works fine giving me the information that I want (which for this report is how many orders have been shipped).
What I am trying to excute is a DCount that lets me determine specifically how many orders have been made that include the exact ShipTo and ShipFrom fields. That is, out of all the various combinations of where an order can be shipped to and from I want to know how many orders have been made to the selected ShipTo field from the selected ShipFrom field. I need this information to be able to display an order status percentage in the report.
My curent dcount is:
=DCount("[OrderID]","qry_OrderStatus","[ShipTo] ='" & [ShipTo] & "' And [ShipFrom] ='" & [ShipFrom] & "' And [Date] BETWEEN [Forms]![OrderFilter]![txtStart] And [Forms]![OrderFilter]![txtEnd] ")
Regardless of what combinations I come up with this number is always lower than what the actual value is. I've tested the output against going into qry_OrderStatus and filtering out the data to match what was entered in the OrderFilter.
The form, report, and query have all executed nicely and given the proper results. I'm not sure where the disconnect is coming with the DCount.