After Adding New Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In VB code I open a table which has records in it and add new records to this
table. After I've completed adding the new records, I go to the last record
in the table (movelast) and I get an error message - invalid use of null.

Anybody have an idea what's going on?

Thanks,

Sarah
 
Do While (Not (MyTable.EOF))
If IsNull(MyTable!SeqNo) Then
MyTable.Edit
MyTable!SeqNo = k + 1
k = k + 1
MyTable.Update
Else
k = MyTable!SeqNo
End If
MyTable.MoveNext
Loop
MyTable.MoveLast
 
I figured it out. I did a delete query to the table I was adding new records
to before I added the new records and apparently the table was not getting
refreshed after the delete. So the code was looking at deleted records that
were not removed from the table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top