first record in a recordset

Matty

...the Myth Buster
Local time
Today, 10:32
Joined
Jun 29, 2001
Messages
395
I've created this module in VBA, and at one point, i use the rst.MovePrevious command. My only problem is that i get an error on the very first record (because it can't go to the previous record). Is there a way for me to check if the current record is the first in the recordset, so i can by-pass the MovePrevious thing?
 
You can catch the error. I think it's 2501

so you can have something like this

-- in your event procedure for the button
private sub movePrevious()
on error goto error_handler

...

end_here:
exit sub

error_handler:
if err.number = 2501 then
'/** do nothing
else
goto end_here
end if

exit sub
 
i think i just figured it out. i'm a goof! if i use the rst.BOF thing, it works! i ALWAYS seem to figure it out about 10 mins after i post a message, so why break the trend, eh?
 

Users who are viewing this thread

Back
Top Bottom