Jim Dettman
jimdettman at verizon.net
Tue Jun 21 08:37:14 CDT 2011
Fundamentally, that's also the way Windows works. Each Window (program) has a message queue. The OS and windows can send messages to the windows and the windows respond to them as they see fit. Overall works pretty well, but it does lead to problems at times (order of events) and it gets terribly inefficient when you have a large number of "broadcast" messages (a message sent to all windows) and a large number of windows receiving that message and trying to process it, which may or may not apply to it. That actually doesn't happen too often in Windows, but the way John is doing it, that always happens. Not too much of a problem though given the limited number of forms that you might have open at one time (maybe half dozen at most?). I might take the additional step of registering/unregistering needed services as forms open or close and modify the message class to only send messages to forms that need them (a Business Object), but that most likely would be overkill. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, June 20, 2011 08:24 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Refreshing open forms when something changes In vb.net, this is the standard and expected way of doing things. It allows the various pieces to be black boxes that do something when they receive a signal. If you need another black box to do something on the same signal, you sink the same event in the second black box. You don't have to change the code that raises the event. It just raises it hand and waves, and any black boxes that are listening do their thing. If there are no listeners, the hand gets some exercise but nothing else results. Access (thank you Microsoft) lets us be sloppy and not learn to use classes effectively. In fact, it makes it relatively difficult to use classes except for the built in object classes, and even those hide much of their inner workings. Charlotte Foust On Mon, Jun 20, 2011 at 2:38 PM, Stuart McLachlan <stuart at lexacorp.com.pg>wrote: <<snip>>