VoodooFrog
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!
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!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I use the master/child link fields and it is by those properties that he subforms are filtered.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you all for your input.
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.