I would build a table with 1 record in it to hold the check number. I'm not
so sure that I'd allow the system to ask for the first number, because it's
too easy for a human to make a mistake.
Then I'd write a function that would go through all the query records and
put a check number in each one, increasing that number by 1. Something like
this:
Public Function GetNextNum() As Long
On Error GoTo Error_Handler
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("tblCheckNumber", dbOpenDynaset)
With rst
rst.MoveFirst
rst.Edit
rst!CheckNumber = rst!CheckNumber + 1
rst.Update
End With
GetNextNum = rst!CheckNumber
Exit_Here:
On Error Resume Next
rst.Close
Set rst = Nothing
Set db = Nothing
Exit Function
Error_Handler:
Resume Exit_Here
End Function
Use that function in your query to add numbers to a query column. Since you
said you want to update a check register when you are done, you may want to
make your query into an Append query and append the records to a temporary
table. Run your check printer report on the data in that table and use those
records to update the check register with the check number, date, and
amount. When you are all done printing the checks and updating the register,
delete the records in the temporary table.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com