how to stop running procedure or function with vba

MBMSOFT

Registered User.
Local time
Today, 15:16
Joined
Jan 29, 2010
Messages
90
I need to stop already ran procedure or function with vba code
So I use END command ans everything stops.. in some cases that is usefull , but some times need I to do something else after I use END command, but after END everything stops...

LIKE THIS :

SUB ()
END
ME.CTL.SETFOCUS
'OR
CALL function
EXIT SUB

ANY IDEA TO SOLVE THIS
THANKS IN ADVANCE
 
I'm not sure I understand MBMSOFT.

You can use Exit Sub to prematurely exit a function. If you don't always want to exit the function you can put it in an IF statement with some condition.
 
It is onother function or procedure or some loop let say started on loading form ... so i want to quit them with some button and start something else...
 
VBA is single threaded so you can't do this. The only way you can somewhat do it is with a boolean variable and the timer.
 

Users who are viewing this thread

Back
Top Bottom