You guys have been great with helping me along... I was wondering if someone could take a look at this code and help me with the logic? I can't figure out how to get out of this procedure once it hits the LAST record. Once it gets to the last record, it looks at the next record and because there is no next record it crashes.... I've been working on trying to make this work for a few hours, but my brain is a little muddled now... Here's the code:
If rst.RecordCount = counter Then
rst.MoveFirst
rst.Edit
rst!InvoiceNumber = "E" & start
rst.Update
Else
rst.MoveFirst
rstchk.MoveFirst
Do Until counter = rst.RecordCount
Let cc = rstchk!ClientCode
Do Until (cc <> rstchk!ClientCode)
rst.Edit
rst!InvoiceNumber = "E" & start
rst.Update
Let counter = counter + 1
rst.MoveNext
rstchk.MoveNext
Loop
Let start = start + 1
Loop
End If
as you can see the error is in most inside do loop.
Thanks again for all the help!
Julie
If rst.RecordCount = counter Then
rst.MoveFirst
rst.Edit
rst!InvoiceNumber = "E" & start
rst.Update
Else
rst.MoveFirst
rstchk.MoveFirst
Do Until counter = rst.RecordCount
Let cc = rstchk!ClientCode
Do Until (cc <> rstchk!ClientCode)
rst.Edit
rst!InvoiceNumber = "E" & start
rst.Update
Let counter = counter + 1
rst.MoveNext
rstchk.MoveNext
Loop
Let start = start + 1
Loop
End If
as you can see the error is in most inside do loop.
Thanks again for all the help!
Julie