<pre>SELECT tblSumServe2.strREF AS Reference,
Count(tblSumServe2.idsKeyOfSumServe2) AS [Count],
Sum(tblSumServe2.curPAYMENT) AS Amounts,
Format(DSum("curPAYMENT","tblSumServe2","[strREF]<=" & [Reference] & ""),"$000,000.00") AS RunTot
FROM tblSumServe2
WHERE ((((tblSumServe2.dteSUMDAY)>=[Enter Start Date: Example m/d/y, or OK for All]
Or (tblSumServe2.dteSUMDAY) Like [Enter Start Date: Example m/d/y, or OK for All] & "*")
And ((tblSumServe2.dteSUMDAY)<=[Enter End Date: Example m/d/y, or OK for All]
Or (tblSumServe2.dteSUMDAY) Like [Enter End Date: Example m/d/y, or OK for All] & "*"))
AND (((tblSumServe2.strBatchNo)>=[Enter Start Batch Number or OK for All]
Or (tblSumServe2.strBatchNo) Like [Enter Start Batch Number or OK for All] & "*")
And ((tblSumServe2.strBatchNo)<=[Enter End Batch Number or OK for All]
Or (tblSumServe2.strBatchNo) Like [Enter End Batch Number or OK for All] & "*")))
GROUP BY tblSumServe2.strREF;
</pre>