I have a continuous form that has the following fields
ActivityID
ContactID
TaxreceiptAmount
ReceipNumber
I need to populate the ReceiptNumber field with numbers that are incremented. Currently I am using the following code and it works perfectly
This looks for the highest receipt number and then simply adds 1 to it on each loop. I need one thing more
Instead of looking for the highest number I want to specify a starting number in a text box txtStartingRecNumber
The problem I am having is all records are then set to the value of txtStartingRecNumber plus 1. It does not increment through. I understand why this is happening, I just don't know what to do to make it work the way I want it.
ActivityID
ContactID
TaxreceiptAmount
ReceipNumber
I need to populate the ReceiptNumber field with numbers that are incremented. Currently I am using the following code and it works perfectly
Code:
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = Forms!pfrm_ActivityRecNumberList.Recordset
Do Until rst.EOF
Me.ReceiptNumber = Nz(DMax("ReceiptNumber", "tbl_Activity")) + 1
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
This looks for the highest receipt number and then simply adds 1 to it on each loop. I need one thing more
Instead of looking for the highest number I want to specify a starting number in a text box txtStartingRecNumber
The problem I am having is all records are then set to the value of txtStartingRecNumber plus 1. It does not increment through. I understand why this is happening, I just don't know what to do to make it work the way I want it.