Taras
asked on
Can not close form with navigation buttons
In Access 2010 I have a main form frm_Main and three other forms: frm_B1, frm_B2, frm_Reports that are located on Main form navigation buttons Nav_B1, Nav_B2, Nav_Rep
They are all unbound forms.
When App starts it opens in frm_B1.
Frm_B1 and frm_B2 are in Parent Child relations.
I am updating tables on close even of frm_B1 and frm_B2 it means when Nav_B1 or Nav_B2 are clicked.
This is working ok, however I have issue with exit from application button.When I put exit button on frm_Main it gives me error: 2450 Microsoft Access cannot find the referenced form “frm_Main”.
On frm_Main I do not have any event happening.
On closing forms I assume that first are closed sub forms then main form, so even if on sub forms frm_Main is referenced it is open and present at that moment and Access should not throw this error.
First I can not figure point where this is happening and triggered and then how to avoid this.
They are all unbound forms.
When App starts it opens in frm_B1.
Frm_B1 and frm_B2 are in Parent Child relations.
I am updating tables on close even of frm_B1 and frm_B2 it means when Nav_B1 or Nav_B2 are clicked.
This is working ok, however I have issue with exit from application button.When I put exit button on frm_Main it gives me error: 2450 Microsoft Access cannot find the referenced form “frm_Main”.
On frm_Main I do not have any event happening.
On closing forms I assume that first are closed sub forms then main form, so even if on sub forms frm_Main is referenced it is open and present at that moment and Access should not throw this error.
First I can not figure point where this is happening and triggered and then how to avoid this.
ASKER
Fabrice, you can not even suggest where to look. Anyway thank you for your time and support.
I was expected that you will tell me open that and that form then go to the line of code that states that and that and that move last coma in string and put double quotes without ampersand.
This is serious site by I like your sense of humor.
I was expected that you will tell me open that and that form then go to the line of code that states that and that and that move last coma in string and put double quotes without ampersand.
This is serious site by I like your sense of humor.
ASKER
If somebody can suggest me how to trap where this error happened?
That would be good starting point.
I have error handling in each procedure.
That would be good starting point.
I have error handling in each procedure.
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.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
John I mentioned that I do not have any event on frm_Main.
So no need to check events on frm_Main.
Dale was close one of sub form frm_B1 in close event call save procedure that was referencing frm_B1 that was NavigationSubform on NavigationForm - frm_Main. So, during closing application(exit) I am not sure in which order forms are closed but
It is always good design not to put in form close event save procedure that referencing some other form.
Those NavigationForm and navigation Navigationsubforms are terrible option for what application front end was doing and are not good design at all.
I inherited this database from somebody else.
Error handling message was not made in such way that you can easy get clue to which procedure it is related to.
It is much better if in error handler beside error number, and error description to add some text about procedure title or procedure name.
Thank you to all.
So no need to check events on frm_Main.
Dale was close one of sub form frm_B1 in close event call save procedure that was referencing frm_B1 that was NavigationSubform on NavigationForm - frm_Main. So, during closing application(exit) I am not sure in which order forms are closed but
It is always good design not to put in form close event save procedure that referencing some other form.
Those NavigationForm and navigation Navigationsubforms are terrible option for what application front end was doing and are not good design at all.
I inherited this database from somebody else.
Error handling message was not made in such way that you can easy get clue to which procedure it is related to.
It is much better if in error handler beside error number, and error description to add some text about procedure title or procedure name.
Thank you to all.
Source code or file please ?
My crystal ball is broken...