McGillivray, Don [IT]
Donald.A.McGillivray at sprint.com
Thu Feb 12 16:58:31 CST 2009
John, I swiped that class off ya some time back. I use it to send progress update messages from a long running procedure back to the form that triggers it. Before I implemented that, I used a separate function that accepted the message string and placed it on the form if it was open. I'm chagrined to admit that I've never really taken the time to understand exactly how it works. I do recall that I tweaked it slightly so that I can target messages to specific text boxes on the target form (i.e., file being processed, main process, sub-process, etc.), so I guess I understood something. Now, thanks to your efforts, it's all getting clearer . . . Don -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, February 12, 2009 2:21 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] More Class lectures? I would suggest that kind of behavior is much easier to implement by using the message class that I floated past a few weeks ago. Given that many of you were not using classes, that email might have gone right over your head. The basics are that we have a class that raises events which I call "messages". The clsMsg is a global class that any class can grab a pointer to. The clsMsg has a method to call which sends a message, and raises the Message event whenever anyone calls that message. That class has an "email" like syntax, with a From, To, Subject and Body variables. So... Customer form grabs a pointer to clsMsg. Orders form grabs a pointer to clsMsg. Customer form calls the Message event of clsMsg, passing off it's form name (frmCustomer) in the from field, the name of the form that the message is intended for (frmOrders) in the To field, and perhaps the CustomerID in the Subject field. The order form is sinking the Message event. Its message sink gets every message going by, but it filters on the To field looking for its own name in the To field. If it sees a message with its name in the To field, it then grabs the CustomerID out of the subject field and uses that to look up the correct customer's orders. Notice that this message class (which I actually have in my framework and use in my applications) is a "generic" communication channel between parts of your program. I will send it along in the next email. John W. Colby www.ColbyConsulting.com Arthur Fuller wrote: > I've done that with the NotInList event too. I did it with a function that > accepts the name of a form, but a class is a cleaner way to go. > > What I was thinking here is that I could have a customer form open and and > orders+details form open at the same time, and that navigating on the > customer form would automatically refresh the orders form, even though they > are separate forms. The same thing could be done with the order details > subform and the products form. > > Arthur > > On Thu, Feb 12, 2009 at 4:43 PM, jwcolby <jwcolby at colbyconsulting.com>wrote: > >> Yep, that will work just fine. What is the implementation idea? >> >> I have a behavior that I actually have embedded in my framework where the >> dbl-Click event of the >> combo can cause a list form to open, navigate to the record in the combo, >> or if the combo item is >> "not in list" opens the list form in Add mode. >> >> Suppose that you have something being displayed in a combo box. Perhaps a >> name / SSN for a person. >> A user is trying to add people in a form using that combo, but notices that >> the name / ssn in the >> combo box appears to be correct but the SSN is off by a digit (just an >> example scenario). The user >> can select that person, then dbl click in the combo. The combo class has >> to have been fed a form to >> open in case of the dbl click. If it has, then the combo opens the form. >> Since the PKID is in >> column 0 of the combo, the combo class "passes in" the PKID of the person >> selected in the combo. >> >> The form as it opens, grabs the PKID and moves to that PKID and places the >> form into Edit mode. >> Voila, instant edit of exactly the correct record in another form. >> >> John W. Colby >> www.ColbyConsulting.com <http://www.colbyconsulting.com/> >> >> >> Arthur Fuller wrote: >>> I've gone all the way with you, JC, and this weekend I plan to try an >>> experiment bearing on the "Sinking Events in Multiple Places" concept -- >>> specifically, two related forms open and navigation on one causes >> parallel >>> navigation on the other, so they stay in synch. Seems like a perfect >>> application of this concept. >>> >>> Arthur >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com This e-mail may contain Sprint Nextel Company proprietary information intended for the sole use of the recipient(s). Any use by others is prohibited. If you are not the intended recipient, please contact the sender and delete all copies of the message.