Link to home
Start Free TrialLog in
Avatar of Bob Collison
Bob CollisonFlag for Canada

asked on

Acess 2010 Form Closes When Another Form Closes In Desgn Mode

Hi Experts,
I have a Form (A) that has a button that opens Form B (not a SubForm) and populates fields on Form B from Form A via the Form Load Event.  There is no direct linkage between the two Forms and they use different Tables..

If I change Form B into Design Mode and then back to View Mode, Form A is closed in the background without any notification.

If I change Form B back to View Mode an Error is produced advising that Form B can't find Form A.

If I simply close Form B from View Mode without having gone to Design Mode, Form B closes and Form A is displayed without any problem.  i.e.  It hasn't been closed.

Is this a Microsoft Bug or am I doing something incorrect?

This would not be easy for me to put into a version to provide you for analysis and the original application is about 100 Meg.

Since this only happens when using Design Mode I can live with it.

Thanks
Bob C.
SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan 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
Avatar of Bob Collison

ASKER

Hi Expert,
The functionality of these forms is as follows.
Form A contains Event Registration data including such things as a Registration Fee, Payment, etc.  Since Form A is active when Form B is opened the data in Form A may not have been saved to its associated Event Registration Table.

Form B contains Event Registration Invoice data in the Event Invoice Table based in large part on the data in Form A.  It also has various functions to print the Invoice, Email an Invoice, etc.

Regarding your questions.
I am attaching a text file containing the code related to your questions.  To summarize.
- Form A doesn't use the acDialog to call Form B.
- There is code referencing Form A in the Form B Load Event.  see attached.
- There is no code in the Form B Open  or Close Form Events referencing Form A or in any other Form B Events.

One solution would be to force the saving of the data in Form A when the button is clicked to Open Form B and then looking the Event Registration Table data up in Form B.  This would eliminate the data references in the Form B Load Event to the Form A Fields.  I assume that this would correct the problem.

If it is viable and I were to go with the solution I proposed above, how do I force the saving of the Form A data to its associated Table when the Button is clicked to open Form B?

Is there another better solution?

Thanks,
Bob C.
EE-Question-Code-Notes.txt
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
Hi Experts,
I appreciate the comment by mbizup however I adopted the solution supplied by gustav.
Thanks for your expertise.
Bob C.
You are welcome!

/gustav