Subform listbox records don't reflect master/child link

E

Elwin

Use the OnCurrent() event of your SUBFORM to requery the
listbox on the subform. This event fires when you move
between records and will force the listbox to re-examine
the OrganizationID.

Me!ListBoxName.Requery
-----Original Message-----
Access 2002. I have a form linked to a subform by the fields
OrganizationID. The subform shows Contacts, and has a listbox, which is
used to select a particular contact for that form and forms below the
Contacts form.
Link Query
Organizations form OrganizationID qryOrganizations
Contacts subform OrganizationID qryContactInfo

Contacts
listbox qryContactInfo
 
N

Nick Mirro

Thanks for helping with this. I used this code for the OnCurrent event of
the subform:


Private Sub Form_Current()

Me![ContactsList].Requery

End Sub


This does not cause the Listbox to update as the parent form is cycled. The
listbox also has code (via wizard) to enable it to be used to set the
current record in the subform based on which row is selected. However, as
has worked previously, cycling the parent form will update other records in
the subform, as well as child subforms of the subform containing the
listbox.

Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top