B
Brian
I made all my forms modal to prevent a problem when shutting down the app,
but I know there is a way to get past it. Scenario (much simplified):
Form1: main menu, with button that runs DoCmd.Quit & a button that opens
Form2 (among many other buttons that open other forms)
Form2: bound input form
I disabled the control box on Form2 to prevent closure of the form when a
record is incomplete, and then run code to ensure various controls are
populated before the user can navigate to another record or close the form.
When a null control is found, the navigation/closure action is cancelled, the
user sees a MsgBox indicating which control is incomplete, and the focus is
passed to the control.
To prevent users from closing the app via Form1 while having an incomplete
record on Form2, I made Form2 modal. However, I would really like to make it
non-modal to accomodate some other user needs.
How do I properly do the following when the user attempts to close the app
from Form1 while there is an incomplete record represented on Form2:
1. Cancel the close operation (from the button on Form1)
2. Pass control back to Form2 so that the user does not get an error when
the completeness-checking code attempts to place the focus on the control on
Form2 that must be completed?
but I know there is a way to get past it. Scenario (much simplified):
Form1: main menu, with button that runs DoCmd.Quit & a button that opens
Form2 (among many other buttons that open other forms)
Form2: bound input form
I disabled the control box on Form2 to prevent closure of the form when a
record is incomplete, and then run code to ensure various controls are
populated before the user can navigate to another record or close the form.
When a null control is found, the navigation/closure action is cancelled, the
user sees a MsgBox indicating which control is incomplete, and the focus is
passed to the control.
To prevent users from closing the app via Form1 while having an incomplete
record on Form2, I made Form2 modal. However, I would really like to make it
non-modal to accomodate some other user needs.
How do I properly do the following when the user attempts to close the app
from Form1 while there is an incomplete record represented on Form2:
1. Cancel the close operation (from the button on Form1)
2. Pass control back to Form2 so that the user does not get an error when
the completeness-checking code attempts to place the focus on the control on
Form2 that must be completed?