How do I pause my sub from executing the rest of the code until the Call from the other sub is finished?
Code:'for example
If then
Do While
Loop
cmdSubmitAll_Click 'I want to wait here while cmdSubmitAll_Click executes
Do While
Loop
End I
Printable View
How do I pause my sub from executing the rest of the code until the Call from the other sub is finished?
Code:'for example
If then
Do While
Loop
cmdSubmitAll_Click 'I want to wait here while cmdSubmitAll_Click executes
Do While
Loop
End I
anyone?
Your code should wait automatically until the call to the sub is complete. That is the way VB code works, unless you are using API calls to manipulate the system and use threads.
use a timer and a flag. Declare a public variable - boolean - for the flag. Set the timer to execute ever x interval if the flag = true, and at the end of the timer's code set the flag back to false. Somewhere in the code for cmdSubmitAll_Click set the flag to true.
Fin ;)
Acoustic that is exactly what I came up with! Glad to know we progammers can think alike.