[AccessD] USING CLSMSGDEMO

Arthur Fuller fuller.artful at gmail.com
Sat Feb 14 07:02:19 CST 2009


I am going to try building the Customers-Orders thing today. I have some
other stuff to do, but this is such fun the other stuff can wait a while :)

Arthur

On Sat, Feb 14, 2009 at 7:43 AM, jwcolby <jwcolby at colbyconsulting.com>wrote:

> Arthur,
>
> We could have checked any of the variables, it doesn't matter which.  Once
> initialized the variables
> will stay initialized until they are set to nothing somehow.  I just use
> the If Var is nothing
> syntax because it is fairly fast code and tests the actual variable we care
> about.  In this case, if
> one is set, the others will be too since there is no way to clear just one
> at a time.
>
> Arthur, I am impressed!  Individually these lectures were pretty short and
> sweet, but there were a
> lot of them and it takes effort to keep with it.  That last lecture will
> probably take some time for
> many folks to work through and really understand the code jumping around.
>
> I like your "Office chatter".  I often use a function like that down in the
> bottom of the
> initialization module exactly as a test harness, just so that I don't have
> to keep typing stuff into
> the debug window.
>
> Was it you who wanted to keep an invoice form synced to a customer form?
>  Now you have a message
> channel to use to keep the forms synced.  Set up mclsMsg in the header of
> the Customer form.
> frmCustomer will then send messages in OnCurrent, in other words every time
> you move through the
> records, send a message saying "I changed records".  In the from, send
> me.Name, Leave "To" blank
> (any form might want to process the messages).  In Subject put
> "CustomerID", and in Msg put the
> actual long integer that is the customer PKID.
>
> Now over in frmInvoice, dim Withevents mclsMsg.  Sink the message event.
>  In the message sink, do an
> "if From = 'frmCustomer' then" and process messages from frmCustomer.  When
> a message comes in with
> CustomerID in the Subj, take the CustomerID in the Msg and use it to filter
> the form to just records
> for that customer.
>
> Dead simple now that you understand classes and sinking events.  You have a
> message class to use as
> the message channel.
>
> Fun stuff!
>
> John W. Colby
> www.ColbyConsulting.com <http://www.colbyconsulting.com/>
>
>



More information about the AccessD mailing list