PDA

View Full Version : Prevent sub routines from running



lifeson
04-04-2007, 03:49 AM
Is there any code to prevent sub routines running?

I have a user form that displays records and it that uses various controls with code activating on change events.
I also have a button which resets the form to allow a new entry to be added, but I want to disable the on chnage routines.
Is this possible?

ie
On cmdButton click ignore Private Sub cboType_Change()

TIA

Bob Phillips
04-04-2007, 04:20 AM
I do it with a simple flag, like so



If Not fReEntry Then
fReEntry = True
'do the event stuff
fReEntry = False
Endif


and then I can set that flag in mu=y code elsewhere.

It works but is cumbersome, as you have to add it to all such events.