As stated, this is an Access 2010 .accdb.
I have a main, navigation form: frmNav.
On frmNav I have a Navigation subform control: NavigationSubForm.
I use docmd browseto to move between tabs on the navigation control.
The first form to load in the NavigationSubForm control is frmInboundShipments.
frmInboundShipments contains a sub form control sfrmListInvoicesByShipment.
sfrmListInvoicesByShipment consists of a filtered datasheet of invoices associated with each shipment in frmInboundShipments.
frmItemInvoices contains the invoices referenced in sfrmListInvoicesByShipment.
The following methods of moving between frmInboundShipments and frmItemInvoices using the browseto command do trigger the UnLoad event on frmInboundShipments:
- Click command button on frmInboundShipments to invoke browseto to frmItemInvoices
- Click the navigation tab/button on the navigation control on frmNav to invoke browseto frmItemInvoices.
However, when I perform the following action(s), the UnLoad event on frmInboundShipments fails to trigger:
Double click on a field/datasheet row in sfrmListInvoicesByShipment to trigger the browseto command to show/move to frmItemInvoices by either:
a. Immediately executing docmd browseto to show frmItemInvoices
b. Set focus first on the parent form, then execute docmd browseto to show frmItemInvoices
i. e.g.: Me.Parent.sfrmListInvoicesByShipments.SetFocus DoCmd.BrowseTo acBrowseToForm, "frmItemInvoices", "frmNav.NavigationSubform", ...criteria....
I can't understand for the life of me why the event doesn't trigger when the browseto command is issued from the subform, but is triggered in every other scenario when navigating between the two forms.
I've looked at the Access 2010 order of events and I don't see anything that explicitly states that the Unload event of the main form would not fire when moving to view another form from the subform.
The Deactivate event also does not fire in this circumstance.
Update, 10/18/13: further investigation reveals that the parent form's Close event does fire, but definitely not the deactivate nor unload events. Problem is that the value I want to capture is already gone once the form Close event occurs. Not sure what to do from here...