I have a subform within a main form that queries records tied with a unique record on the main form. I have the following sub in my code:
Private Sub Form_Load()
Me.RecordSource = Me.RecordSource
Me.Child231.Form.Filter = "[RecordID]= '" & Me.CompName & "'"
Me.Child231.Form.FilterOn = True
This updates the subform so it only displays records pertaining to the record selected on the main form. However, when I click next record on the main form, the subform continues to display records pertaining to the first record viewed in the main form. I'd like for the subform to refresh itself so it displays recorded pertaining to the record selected in the main form.
I attempted to try to requery the subform in Private Sub CompName_AfterUpdate() but that did not seem to do anything.
Thanks in advanced!