Link to home
Start Free TrialLog in
Avatar of VoodooFrog
VoodooFrogFlag for United States of America

asked on

MS Access: Error 3021: No Current Record.

Sometimes when a user closes a form that has an empty recordset on a subform I get the following error message
     Error '3021': No current record.
I can catch and ignore this error with the form's On Error event.  However, I was wondering if there is a way to universally ignore this error throughout the whole project instead of setting every form's on error event?

Thanks!
Avatar of Rog D
Rog D
Flag of United States of America image


It might be a good idea to investigate why you are getting this error.

I have done a lot of forms in MSAccess and have not had to deal with this type of error very often.

So maybe it has something to do with what you are doing or have done before the form is being closed.

As for a solution to your problem globally,  I don't think you can actually ignore any one type error but not others.

Explain more about what is going on and maybe we can help you find a solution where this error doesn't happen.

Avatar of VoodooFrog

ASKER

The forms this happens on are bound to linked tables that reside on an SQL server. The only consistant scenario where this error occurs is that a form has an empt recordset usually due to a bound subform being filtered by that master form. This error can not be consistantly reproduced on any of my forms, and I have not found a way to predict which forms this may happen on.
SOLUTION
Avatar of Rog D
Rog D
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I use the master/child link fields and it is by those properties that he subforms are filtered.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you all for your input.