I have a form in which I open all recordsets I use in the form in the Form OnOpen event. Since then, I have had two occasions where I must close the form abruptly at points where some recordsets appear not to be set as I am receiving the error in the Form OnClose event when closing the recordsets of "Object variable with block variable not set."
I attempted to work around this by setting all the recordsets again before closing them in this OnClose event but am receiving the same error when this code executes.
I am clueless as to why this is happening. The Form OnOpen event is the first procedure in the class module where I am setting these recordsets and they are not coded closed until the OnClose event of the form.
What am I doing wrong? Is there a way I can test the recordsets with an IF statement. What bugs me the most is that I am sure the recordsets ARE set and the database is set first to CurrentDB.
Any advice will be much appreciated.
I attempted to work around this by setting all the recordsets again before closing them in this OnClose event but am receiving the same error when this code executes.
I am clueless as to why this is happening. The Form OnOpen event is the first procedure in the class module where I am setting these recordsets and they are not coded closed until the OnClose event of the form.
What am I doing wrong? Is there a way I can test the recordsets with an IF statement. What bugs me the most is that I am sure the recordsets ARE set and the database is set first to CurrentDB.
Any advice will be much appreciated.