[AccessD] Two levels up (or down) , twice removed

Max Wanadoo max.wanadoo at gmail.com
Wed Feb 3 01:16:58 CST 2010


You are correct in the loading order but if you have your links set up
correctly they work as  expected. I have thousands of example over the
years and the parent is NEVER a step behind the sub form.  Use the wizard to
load the sub  form into the main form and set the link criteria via that and
it will work.

Max


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: 03 February 2010 04:55
To: Access Developers discussion and problem solving
Subject: [AccessD] Two levels up (or down) , twice removed

As you probably know by now, subforms load before parent forms, and their
current events fire before 
the parent's current event.  It always puzzled me how they pull off this
trick, but they do.

Usually this is not a problem but it can be.  For example, the main form has
a "client" combo / 
field.  The child form does not use or care about that.  The grandchild form
however needs that 
value to filter a combo to only display records from a table for that
specific client.

In this case, it doesn't appear to work correctly.  The combo in the
grandchild form is always a 
step behind the parent form, IOW if the parent displays client A, the combo
in the grandchild 
displays whatever the parent had the PREVIOUS record.

So the current event of the main form fires last after all of the child /
grandchild forms load (and 
their load / current events fire).  Logically, that current event of the
main form needs to reach 
two levels down and tell that combo to requery itself.

What a PITA.

I actually built in to my framework collections of dependent child objects
so that I could tell a 
form or a control on a form that "these objects are dependent on your data"
and call those objects 
and requery them.  Of course I have to write code in the load event of the
form to set up the 
dependent object hierarchy.

So how do YOU handle this kind of situation?

Curious minds want to know.

-- 
John W. Colby
www.ColbyConsulting.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list