LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.excel.programming,microsoft.public.word.vba.userforms
external usenet poster
 
Posts: 4
Default Force event code to NOT respond

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.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force Worksheet_Change event [email protected] Excel Programming 1 April 10th 06 08:28 PM
How can I force my code to wait saita Excel Programming 2 September 30th 05 02:27 AM
excel.application.run macro1 -- added code to respond "yes" to a inputbox Michael Joe Excel Programming 3 August 13th 04 10:11 PM
Force code to compile quartz[_2_] Excel Programming 2 August 6th 04 09:37 PM


All times are GMT +1. The time now is 10:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright Š2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"