Hello,
I am using the module (below) to add a unique serial number to Invoices being produced in batch print runs.
The code enables the report to print one page of an invoice with number 0001, then the next with 0002 and so on...
********************
Function FncInvoiceNo()
Dim rs As ADODB.Recordset
Dim NextCounter As Long
Set rs = New ADODB.Recordset
'Open the ADO recordset.
rs.Open "tblInvoiceNo", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
'Get the next counter.
NextCounter = rs!invoice_no
rs!invoice_no = NextCounter + 1
NextCounter = rs!invoice_no
rs.Update
Set rs = Nothing
FncInvoiceNo = NextCounter
End Function
********************
Can anyone tell me how I could alter it so that it increments at intervals, so that it enables the report to print the invoices 001, 001, 002, 002 or more..
Thank you
Regards,
Garry
I am using the module (below) to add a unique serial number to Invoices being produced in batch print runs.
The code enables the report to print one page of an invoice with number 0001, then the next with 0002 and so on...
********************
Function FncInvoiceNo()
Dim rs As ADODB.Recordset
Dim NextCounter As Long
Set rs = New ADODB.Recordset
'Open the ADO recordset.
rs.Open "tblInvoiceNo", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
'Get the next counter.
NextCounter = rs!invoice_no
rs!invoice_no = NextCounter + 1
NextCounter = rs!invoice_no
rs.Update
Set rs = Nothing
FncInvoiceNo = NextCounter
End Function
********************
Can anyone tell me how I could alter it so that it increments at intervals, so that it enables the report to print the invoices 001, 001, 002, 002 or more..
Thank you
Regards,
Garry