I have a question regarding getting VBA code to pause or wait for another process to complete.
Here is my dilema:
I have a form (let's call it Form1) with a command button on it which runs some VBA code in the on the click event.
In the middle of this code, I may determine that it is necessary to open another form (Form2) so that the user can enter some data to create a new record.
I need a way, in the Form1 code, to wait for the activity in Form2 to complete and then resume the code.
In other words, when the code in Form1 determines it needs to open Form2, it can open Form2 and then monitor whether Form2 is open and when it determines Form2 is closed, the Form1 code will resume where it left off.
I thought of using the forms timer as a solution but it will not work unless I can somehow in the Form1 code do some sort of check every X seconds to see if Form2 is open or not and then Resume processing when it determines Form2 has been closed by the User.
Has anyone had to do something similar and have a solution?
Thanks !
Paul
Here is my dilema:
I have a form (let's call it Form1) with a command button on it which runs some VBA code in the on the click event.
In the middle of this code, I may determine that it is necessary to open another form (Form2) so that the user can enter some data to create a new record.
I need a way, in the Form1 code, to wait for the activity in Form2 to complete and then resume the code.
In other words, when the code in Form1 determines it needs to open Form2, it can open Form2 and then monitor whether Form2 is open and when it determines Form2 is closed, the Form1 code will resume where it left off.
I thought of using the forms timer as a solution but it will not work unless I can somehow in the Form1 code do some sort of check every X seconds to see if Form2 is open or not and then Resume processing when it determines Form2 has been closed by the User.
Has anyone had to do something similar and have a solution?
Thanks !
Paul