I have a report that counts the number of records in each section. I would like to sort the layout of the report based on highest to lowest values shown in the count? The 'sort ascending' / 'sort descending' isn't available for an =count(*) box.
I tried setting the control source as a count in one of my queries (ex query1), however, the record source for the entire report is a separate query (ex query2) and I keep getting a parameter entry box for query1, which I try to link the count to (since this query contains a count field but query2 does not).
This question builds off a previous thread, here's the link for clarification https://www.accessforums.net/reports...ort-52977.html
Code query1:
SELECT TOP 4 Count(tblMasterData.NonConformance) AS CountOfNonConformance, tblMasterData.PartNumber, tblMasterData.NonConformance
FROM tblMasterData
GROUP BY tblMasterData.PartNumber, tblMasterData.NonConformance
HAVING (((tblMasterData.PartNumber)=[Enter Part # to Search]))
ORDER BY Count(tblMasterData.NonConformance) DESC;
Code query2:
SELECT tblMasterData.ID, tblMasterData.PartNumber, tblMasterData.EntryDate, tblMasterData.Commodity, tblMasterData.NonConformance
FROM tblMasterData INNER JOIN qryPartSearch ON (tblMasterData.NonConformance=qryPartSearch.NonCon formance) AND (tblMasterData.PartNumber=qryPartSearch.PartNumber )
ORDER BY tblMasterData.Commodity, tblMasterData.NonConformance;