S
SuzyQ
I have a subform within a subform within a subform within the main form. On
the main form there are other subforms as well. My problem is that when
information is entered into one of the subforms off of the main form, I need
to cause a requery in a combo box in the nested form, so that when the user
gets to that form, the information will be available to select. I have tried
the following code with only partial success...
This code is in the event of the combo box itself -
Private Sub LogPesticideID_GotFocus()
Me.LogPesticideID.Requery
End Sub
It only works if the user clicks on the field, tabs to the next field and
then tabs back.
I tried this code in the subforms parent form
Private Sub Form_Current()
Me.frmApplicationLogRouteTankPesticidesSubform.Form.LogPesticideID.Requery
End Sub
That only works if the user changes records on that form and then returns to
the record that they want to enter data for.
I also tried lost focus of the immediate parent form - but since it doesn't
lose focus that doesn't work. And some other locations that I don't even
remember now.
Which form should I put the code in and under which event? I would try
putting it in update of lost focus of the form that caries the data that the
other one needs to see, but I don't know if I can or how to identify the
innermost form to requery from an outer form IE. data is entered into
mainform -> subform1 and in mainform -> subform2 -> sub-subform1 ->
sub-sub-subform1 - > combo box needs to be requeried based on the data
entered in mainform -> subform1
the main form there are other subforms as well. My problem is that when
information is entered into one of the subforms off of the main form, I need
to cause a requery in a combo box in the nested form, so that when the user
gets to that form, the information will be available to select. I have tried
the following code with only partial success...
This code is in the event of the combo box itself -
Private Sub LogPesticideID_GotFocus()
Me.LogPesticideID.Requery
End Sub
It only works if the user clicks on the field, tabs to the next field and
then tabs back.
I tried this code in the subforms parent form
Private Sub Form_Current()
Me.frmApplicationLogRouteTankPesticidesSubform.Form.LogPesticideID.Requery
End Sub
That only works if the user changes records on that form and then returns to
the record that they want to enter data for.
I also tried lost focus of the immediate parent form - but since it doesn't
lose focus that doesn't work. And some other locations that I don't even
remember now.
Which form should I put the code in and under which event? I would try
putting it in update of lost focus of the form that caries the data that the
other one needs to see, but I don't know if I can or how to identify the
innermost form to requery from an outer form IE. data is entered into
mainform -> subform1 and in mainform -> subform2 -> sub-subform1 ->
sub-sub-subform1 - > combo box needs to be requeried based on the data
entered in mainform -> subform1