467,180 Members | 1,159 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,180 developers. It's quick & easy.

How to bypass 'No current record' error

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
  • viewed: 24852
Share:
3 Replies
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
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
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.

Similar topics

2 posts views Thread by Tony | last post: by
2 posts views Thread by Thomas Guignard | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.