Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

After delete "No current record" when EOF

Status
Not open for further replies.

gdev

Technical User
Mar 12, 2001
38
0
0
Hi,

DoCmd.RunCommand acCmdDeleteRecord works fine except when the current record is the last record. I get a "no current record" error message.

I have tried rst.movefirst and rst.moveprevious after the command but I still get the error message.

Please tell me what I am doing wrong?


Thanks
Gwen
 
gdev ,

I am not sure, but try this..

Code:
' do this
  DoCmd.RunCommand acCmdSelectRecord
' Then do this
  DoCmd.RunCommand acCmdDeleteRecord

 
I think it's only occuring when there's no record left, and perhaps due to the method of deletion, so I think I'd just handle it in the error handler.

[tt]on error goto myerr
' perform your delete

myexit:
exit sub
myerr:
if err.number<>3021 then
msgbox err.description
end if
resume myexit
end sub[/tt]

I e - just don't show the error message if it's the 3021...

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top