View Single Post
 
Old July 23rd, 2010, 05:20 AM
dhunym dhunym is offline
Registered User
 
Join Date: Jun 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 5 pg 167 - When Delete last record - crash

Quote:
Originally Posted by boblarson View Post
Again, this is an old post but I'll post an answer in hope of helping someone at a later date.

You can easily add an error handler and trap for error 3021 and then just exit the sub or function when you encounter it.
What the solution to add / change codes to prevent it crash - how to do it

If Not rsContacts.EOF Then
rsContacts.MoveNext
'save the id of the current (next)record
intCurContact = rsContacts!PCNumber
End If

error didplay: runtime error 3021 - either BOF or EOF is TRUE or the current has been deleted