I'm attempting to do a running count on records in a query and reset the count starting again at 1 for each group of records displayed. Following are my fields and sample date.
printref - primary key AutoNumber
TProdRef1 - Product reference
I do have other fields in the query, 6 in total but the two fields above are the ones I'm interested in working with.
Sample Data
printref TProdRef1 Running count
89 2 1
90 2 2
91 2 3
92 5 1
93 5 2
94 6 1
I have tried many variants of the following but am n ot getting the result i'm looking for. RunningCount: Val(DCount("printref","TPrint Data Store","TprodRef1 <= " & [TProdRef1]))
would appreciate any suggestions. Regards
printref - primary key AutoNumber
TProdRef1 - Product reference
I do have other fields in the query, 6 in total but the two fields above are the ones I'm interested in working with.
Sample Data
printref TProdRef1 Running count
89 2 1
90 2 2
91 2 3
92 5 1
93 5 2
94 6 1
I have tried many variants of the following but am n ot getting the result i'm looking for. RunningCount: Val(DCount("printref","TPrint Data Store","TprodRef1 <= " & [TProdRef1]))
would appreciate any suggestions. Regards
