G
Guest
I have a form with two sub-forms, one of which itself has a sub-form (a sub-sub-form). They all work fine and remain nicely synchronized. However, the sub-sub-form has a combo box based on a table which is updated according to variables calculated in the VBA associated with the main form and in the other sub-form (not the parent of the sub-sub-form) and herein lies the problem. The sub-sub loads before the code runs in the unrelated sub-form and, of course, in the main form. Consequently, the sub-sub-form opens without the required options set in its combo box.
I cannot currently see an easy way around this other than, perhaps, for the main form to have just the sub-form which is not the parent of the sub-sub-form and then to open a dummy form from the main form, making the parent of the sub-sub-form a sub form of the dummy form. That would get the sequencing right but I cannot but help thinking that there should be an easier way, particularly because, apart from the one combo box, the original design works so well
I thought that a well-placed requery of the sub-sub-form might work but I am not quite sure how. Incidentally, how does one refer to the sub-sub-form from the main form? I would be tempted to write Forms![frm_Parent_Form]![sfrm_Child_SubForm]![sfrm_Grandchild_Sub-subForm] but I have come unstuck with that sort of reasoning in the past.
I cannot currently see an easy way around this other than, perhaps, for the main form to have just the sub-form which is not the parent of the sub-sub-form and then to open a dummy form from the main form, making the parent of the sub-sub-form a sub form of the dummy form. That would get the sequencing right but I cannot but help thinking that there should be an easier way, particularly because, apart from the one combo box, the original design works so well
I thought that a well-placed requery of the sub-sub-form might work but I am not quite sure how. Incidentally, how does one refer to the sub-sub-form from the main form? I would be tempted to write Forms![frm_Parent_Form]![sfrm_Child_SubForm]![sfrm_Grandchild_Sub-subForm] but I have come unstuck with that sort of reasoning in the past.