By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,619 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,619 IT Pros & Developers. It's quick & easy.

How to bypass 'No current record' error

P: n/a
When I delete a record in a subform I get the warning that I'm about to
delete a record, followed by an error "No current record." When I
click OK obviously the record is deleted and it goes to the first
record (as I've coded it to do) or it shows me a blank record if the
deleted record was the only one.

So, what I'd like to do is bypass that 'No current record' altogether
to avoid user confusion. Is there any way to code it out without
ignoring my error handling?

Thanks!!

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
If is occurs in Access 2002 Service Pack 3, then it is a known bug.

Temporarily comment out any error handler handler so your code pauses at the
error. Note the error number. In the error handler part of your code, just
ignore that error, i.e. insert:
If Err.Number <> xxxx Then

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"hebandgene" <sa*****@yahoo.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
When I delete a record in a subform I get the warning that I'm about to
delete a record, followed by an error "No current record." When I
click OK obviously the record is deleted and it goes to the first
record (as I've coded it to do) or it shows me a blank record if the
deleted record was the only one.

So, what I'd like to do is bypass that 'No current record' altogether
to avoid user confusion. Is there any way to code it out without
ignoring my error handling?

Nov 13 '05 #2

P: n/a
Allen, THANK YOU! That is exactly what I needed. However, my error
didn't have a number so I used...

If Err.Description = "No current record" Then Resume
Exit_cmdDeleteWall_Click

Doin' the Access Happy Dance...
Heather

Nov 13 '05 #3

P: n/a
It does have a number, given by Err.Number.

I believe this one is 3021.

(Better to use the numbers, in case MS changes the messages, or your db is
used in a different language.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"hebandgene" <sa*****@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Allen, THANK YOU! That is exactly what I needed. However, my error
didn't have a number so I used...

If Err.Description = "No current record" Then Resume
Exit_cmdDeleteWall_Click

Doin' the Access Happy Dance...
Heather

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.