Sorry for letting you wait, I was ut of the office for a few days.
Here is what I did
DCount("AccountNo","tblUnique","RecordID<=" & [tblUnique].[RecordID]).
Now all this is a workaround to what I really wanted to accomplish.
What I really need is:
I have got a subform
Field1 = RecordID
Field2 = AccountNo
Field3 = Receipt
I would like to have a button that gives to each AccountNo a receipt no, meaning that if there is a few of the same AccountNo's it should all have the same Receipt #, and so on.
My workaround is. I append to a new table all the unique AccounNo's, with the running sum I increment a ReceiptNo for each AccountNo, then with an Update Query I Do the ReceiptNo on the Form. Its all being done in vba, so for the user its still one button, but for me my question is, Is there an easier way