Bryan Carbonnell
Bryan_Carbonnell at cbc.ca
Thu Mar 11 08:56:07 CST 2004
> Obviously if we add combo A to combo B's DependentObject collection and we > add Combo B to Combo A's dependent object collection, then we start an > endless loop where A requeries B which requeries A which requeries B... Maybe Im missing something painfully obvious but..... Why would you end up with an endless loop? Here is what I am understanding... If A is dependant on B and B is dependant on A, they need to be requeried when the other's value changes. Since you are adding to A, then the logical assumption is that the value of A will change to the newly entered value. But B's value won't change, wil it? The underlying datasource may change, but the actual value won't. So since Bs value didn't change A won't need to be requried. Therefore no loop. Or the other way around: Since you are adding to B, then the logical assumption is that the value of B will change to the newly entered value. But A's value won't change, wil it? The underlying datasource may change, but the actual value won't. So since As value didn't change B won't need to be requried. Therefore no loop. No?? Like I said I may be missing something painfully obvious. It wouldn't be the first time :-) Bryan Carbonnell bryan_carbonnell at cbc.ca >>> jwcolby at colbyconsulting.com 11-Mar-04 12:11:22 AM >>> I am working on a dependentobjects class, i.e. a class with a collection which holds objects (classes) where the control or form is dependent on the current control. Combo A changes. Combo B uses Combo A to filter itself. Combo B is "dependent" on combo A and must be requeried whenever Combo A changes. There is a case where two combos on a form may display data from the same table. For example two combos both display cities from the cities lookup table. If Combo A NotInList adds a new city. Combo B needs to requery in order to display that new city if necessary. However if Combo B adds the city, then Combo A needs to requery. Obviously if we add combo A to combo B's DependentObject collection and we add Combo B to Combo A's dependent object collection, then we start an endless loop where A requeries B which requeries A which requeries B... This is a case where I programmed a solution working but it was ugly. How would you solve this problem?