I have a relatively simple VBA project which includes a simple user authentication form, a simple menu form and then a series of forms which perform different functions.
So far, everything has been working exactly as intended. However, during testing today I observed something not previously seen... The sequence to create the problem is:-
From the menu screen, have an operator request access to a functional form. The Menu code then invokes this with a Form_Load() call - this works flawlessly. However, I then have my user decide that they made a mistake and want to return to the Menu. They click a "Cancel" button and sure enough they are returned to the Menu, again perfectly.
If I then have them change their mind a second time - i.e. re-enter the form, it is displayed for the user, but this seems to be happening without the Form_Load() method being invoked.
It looks to me [I am not sure] as though VBA uses a different method when it "shows" a Form that has been previously loaded - in other words, even though I am using Form_Load both times, for the second invocation the engine is doing something slightly different.
Can anyone direct me to the method or function that would be invoked in such a scenario please? I would like to insert some of my own logic to trigger on that event, so that fields on the form are populated on entry. The logic that I have in my "Form_Load" method is not being triggered on re-entry...
Thank you in advance for any suggestions.
So far, everything has been working exactly as intended. However, during testing today I observed something not previously seen... The sequence to create the problem is:-
From the menu screen, have an operator request access to a functional form. The Menu code then invokes this with a Form_Load() call - this works flawlessly. However, I then have my user decide that they made a mistake and want to return to the Menu. They click a "Cancel" button and sure enough they are returned to the Menu, again perfectly.
If I then have them change their mind a second time - i.e. re-enter the form, it is displayed for the user, but this seems to be happening without the Form_Load() method being invoked.
It looks to me [I am not sure] as though VBA uses a different method when it "shows" a Form that has been previously loaded - in other words, even though I am using Form_Load both times, for the second invocation the engine is doing something slightly different.
Can anyone direct me to the method or function that would be invoked in such a scenario please? I would like to insert some of my own logic to trigger on that event, so that fields on the form are populated on entry. The logic that I have in my "Form_Load" method is not being triggered on re-entry...
Thank you in advance for any suggestions.