The following SQL can be used as a guide for the query of your subform. You will have to update the table name, field name, and add additional fields to the select that you need for your subform.
SELECT Count(*) AS LineNo, tblYourTable.OrderNumber
FROM tblYourTable, tblYourTable AS tblYourTable_1
WHERE (((tblYourTable_1.OrderNumber)<=tblYourTable.OrderNumber))
GROUP BY tblYourTable.OrderNumber
ORDER BY Count(*);
Let me know if you need additional assistance with this.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.