Connecting Tech Pros Worldwide Forums | Help | Site Map

How to bypass 'No current record' error

hebandgene
Guest
 
Posts: n/a
#1: Nov 13 '05
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!!


Allen Browne
Guest
 
Posts: n/a
#2: Nov 13 '05

re: How to bypass 'No current record' error


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" <sammi90@yahoo.com> wrote in message
news:1107472699.275599.214400@c13g2000cwb.googlegr oups.com...[color=blue]
> 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?[/color]


hebandgene
Guest
 
Posts: n/a
#3: Nov 13 '05

re: How to bypass 'No current record' error


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

Allen Browne
Guest
 
Posts: n/a
#4: Nov 13 '05

re: How to bypass 'No current record' error


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" <sammi90@yahoo.com> wrote in message
news:1107529648.646679.245970@z14g2000cwz.googlegr oups.com...[color=blue]
> 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
>[/color]


Closed Thread