Bilbo_Baggins_Esq
Registered User.
- Local time
- , 18:18
- Joined
- Jul 5, 2007
- Messages
- 586
I'm curious to know, is there some way for the Form load event to cancel its own opening process?
Scenario
in form 1, a button is clicked to open form 2
Form 2 has an on load event to populate the necessary information fields in form 2
The on load process for form 2 determines there is no action to complete within form 2
Can the open process be cancelled within the form 2 on load event and return to form 1?
If so, does anybody have a sample of what that code might look like?
Before you suggest it, yes, I know I could simply run the tests in form 1 and disable the form 2 button if there is nothing to do in form 2.
However, for this application, the functionaliy in form 2 is VERY RARELY used and the calculations necessary are many and complex.
Form 1 is the launching point for several other processes and the calculations necessay to disable that one button would have to run every single time form 1 loads.
Thusly, it would be far better to only run the necessary calculations on the rare occasioins during which form 2 might be needed, when form 2 loads.
Also, I could add a button in form 2 to close form 2, but would prefer to avoid it if possible.
Scenario
in form 1, a button is clicked to open form 2
Form 2 has an on load event to populate the necessary information fields in form 2
The on load process for form 2 determines there is no action to complete within form 2
Can the open process be cancelled within the form 2 on load event and return to form 1?
If so, does anybody have a sample of what that code might look like?
Before you suggest it, yes, I know I could simply run the tests in form 1 and disable the form 2 button if there is nothing to do in form 2.
However, for this application, the functionaliy in form 2 is VERY RARELY used and the calculations necessary are many and complex.
Form 1 is the launching point for several other processes and the calculations necessay to disable that one button would have to run every single time form 1 loads.
Thusly, it would be far better to only run the necessary calculations on the rare occasioins during which form 2 might be needed, when form 2 loads.
Also, I could add a button in form 2 to close form 2, but would prefer to avoid it if possible.