Check numbers

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi!

I have a check register query almost done. I need to
prompt for the starting check number and have it place
that in the first record and then add 1 to each subsequent
record. It seems like it should be easy but I am not
getting it.

Thanks
Mike
 
Dim wrk As Workspace
Dim db As Database
Dim rs As Recordset
Dim x As Integer

Set wrk = DBEngine.Workspaces(0)
Set db = wrk.Databases(0)

Set rs = db.OpenRecordset("zCHECKREGISTERAPPEND")
x = 0

Do Until rs.EOF
rs.Edit
rs![CHECKNUMBER] = rs![CHECKNUMBER] + x
x = x + 1
rs.Update
rs.MoveNext
Loop
rs.Close

Here is the code I have and it has worked for 4 years now.
 
Back
Top