P
Peter Danes
I have this problem in all three Office products which I regularly program,
Access, Excel and Word.
I write event handlers to respond to (for instance) a change event, but my
intention is to respond only to changes made by the user. The problem I have
often encountered is that somewhere in code I have reason to change the
contents of a form control and that also fires the change event. The only
way I have found so far to deal with this is to set some sort of global
variable (or sometimes the .Tag property) and have the event code check the
status of that global variable to determine whether it should in fact
respond to the change event, or just exit again immediately.
This works, but it's awkward to code and prone to logic bugs. Does anyone
know of a better way to deal with events that are triggered by code when I
want the event code to respond ONLY to activities by the user?
Pete
This e-mail address is fake to keep spammers and their auto-harvesters out
of my hair. If you need to get in touch personally, I am 'pdanes' and I use
Yahoo mail. But please use the newsgroups whenever possible, so that all may
benefit from the exchange of ideas.
Access, Excel and Word.
I write event handlers to respond to (for instance) a change event, but my
intention is to respond only to changes made by the user. The problem I have
often encountered is that somewhere in code I have reason to change the
contents of a form control and that also fires the change event. The only
way I have found so far to deal with this is to set some sort of global
variable (or sometimes the .Tag property) and have the event code check the
status of that global variable to determine whether it should in fact
respond to the change event, or just exit again immediately.
This works, but it's awkward to code and prone to logic bugs. Does anyone
know of a better way to deal with events that are triggered by code when I
want the event code to respond ONLY to activities by the user?
Pete
This e-mail address is fake to keep spammers and their auto-harvesters out
of my hair. If you need to get in touch personally, I am 'pdanes' and I use
Yahoo mail. But please use the newsgroups whenever possible, so that all may
benefit from the exchange of ideas.