Is there a way to do something like this , suppose i am have finished executing a procedure in my module then i want to go to the last line of another procedure in my form. Is this possible?
Printable View
Is there a way to do something like this , suppose i am have finished executing a procedure in my module then i want to go to the last line of another procedure in my form. Is this possible?
You can only branch to another line in the current Subroutine/Procedure. Using GOTO is not a very good solution in any case. What you should do, it break the procedure (where you want to jump to), into another procedure. Call it from both places you need to like....
public Sub FirstRoutine()
StuffIWantToDoInFirstRoutine
Call CommonRoutine
End Sub
public Sub SecondRoutine()
StuffIWantToDoInFirstRoutine
Call CommonRoutine
End Sub
public Sub CommonRoutine()
StuffIWantToDoInBothRoutines
End Sub
After you call the common routine, flow will continue back with the calling procedure.
Hope this helps
Excelent answer. If "eng" do not rate it, I do!
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.