turn event procedure on off

timothyl

Registered User.
Local time
Today, 12:17
Joined
Jun 4, 2009
Messages
92
I have a form with texts boxes and comboboxes, some have event procedures behind them, is there a way to turn an E.P on and off with code behind a command button or check box. I have looked in my begining vba books and googling but no luck, Thanks
 
What is the reason for Off and On E.P.
 
It's a search form and depending on what I'm using it for the E.P is usfull or not. Now the E.P is exacuted on lost focus, I could move it to on click so that I can tab, but I'm trying to learn vba and wanted to see the code that would do this as it seems like a vary usefull thing to do.
 
Last edited:
Assume, you want to execute a E.P. when the field ABC < 21, but you
don't want to execute it, if in the field is > 20. In that case in your Sub put;

Sub xy
If Me.ABC > 20 Then
Exit Sub
Else
....do here what you want.
End If
 
depends how you want to manage it

sometimes I have an unbound visible checkbox - which I can click or not, but then the programme can test this before deciding whether to do certain actions or not.
 

Users who are viewing this thread

Back
Top Bottom