For every LineNumber I want to have a consecutive number given to count up each time the LineNumber occurs. I am using a Dsum but all it does so far is give a total number of times the LineNumber occurs and not a consecutive.
SELECT PayItems.UniqueID, PayItems.LineNumber, DSum(1,"[PayItems]","[LineNumber] = " & [LineNumber]) AS Total
FROM 266GeneralInfo INNER JOIN PayItems ON [266GeneralInfo].FormID=PayItems.FormID
ORDER BY PayItems.LineNumber;