Regina Whipp

The difficult I do immediately, the impossible takes a little bit longer.

OrderBy OR Order By

Queries

When you try to open a report it asks for the parameter value for tblYourTable.ytYourField.  Only problem is that field is not part of the Query or Report, anymore.  So why is it asking…

 

It is getting that value from a field you previously had in the query AND used it to sort by.

While SELECT query below is Ordered By the Order By…

 

SELECT tblCoilReceiving.crCustomerID, Sum(tblLifts.lCalcNet) AS Shipped, Val(Format([bolShipDate],"yyyy")) AS ByYear

 

FROM tblCoilReceiving LEFT JOIN (tblBillOfLading RIGHT JOIN tblLifts ON tblBillOfLading.bolBillOfLadingID = tblLifts.lBillOfLadingID) ON tblCoilReceiving.crCoilID = tblLifts.lCoilID

 

GROUP BY tblCoilReceiving.crCustomerID, Val(Format([bolShipDate],"yyyy"))

 

HAVING (((Val(Format([bolShipDate],"yyyy")))>0))

 

ORDER BY tblCoilReceiving.crCustomerID, Val(Format([bolShipDate],"yyyy"));

 

 

If you open the query and Sort By the Data Sort buttons (See red circle to right), the query will place that sort order in Order By Properties of the query, which in this case is *Shipped*.

If you remove that field from the Query it does not delete the Order By of the Query and subsequently, the next time the Query or Report, which has the Query as it’s RecordSource, is opened it is going to prompt me for that value.  Just open the Query in Design View and delete it, no more prompt.