Just FYI, earlier discussion on this topic is available at AWF.
https://www.access-programmers.co.uk/forums/threads/form-closes-before-unload-event.319483/
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a form where I need to do some processing during the Unload event. In the Unload event, I then reference form data successfully 99.99% of the time, but every so often, I get an error indicating that the form may already be closed.
However, I have an error report that fires due to the above-mentioned error, where I list all the open forms, and the form where I'm running the unload event is still listed as open.
Are there any reason I should not reference a form during its Unload event?
Just FYI, earlier discussion on this topic is available at AWF.
https://www.access-programmers.co.uk/forums/threads/form-closes-before-unload-event.319483/
If you assign the data in the form's controls to a globally exposed array in the form's Current event procedure, and in its AfterUpdate event procedure you'll then be able to read data from the array even if the form has closed.
What would you want to do if the form is at an empty new record? If you don't want to assign Nulls to the array, you'd need to make the assignment in the Current event procedure conditional on the NewRecord property being False.