update subform from main form

  • Thread starter Thread starter DeVille
  • Start date Start date
D

DeVille

Hi I have a subform which is linked to my main form by a
combo box. So that if I choose a customers name on the
main form in the combo box [CustomerName] the customer's
address details appear in the subform. The problem I am
having is that when I change the value in the combo box
on the main form, I have to go to the next record on the
main form then come back and the address details are in
the subform. I would like to have my subform work so the
address details update as soon as I change the customers
name on the main form. If any one can help thanks in
advance
 
Put this code on the combo box's AfterUpdate event:

Private Sub cboBoxName_AfterUpdate()
Me.Subform.Requery
End Sub

where Subform is the name of the subform control (the control that holds the
subform).
 
Back
Top