Say I have the parent form: FormA that has a listbox: lst1 and it has a few rows say displaying people's names.
When a row in this list is selected, it should populate a listbox: lst2 on the subform: FormB, with relevant data, say the selected person's children.
I put the subform on a page of FormA actually, say PageA1.
I suppose I should populate lst2.rowsource with query that selects the children where parent = lst1.value.
I suppose the syntax of the query in lst2.rowsource is:
- SELECT child_id, child_name FROM child_table
-
WHERE parent_id=Forms!FormA.lst1
?
And to refresh the content of lst2, I should put the requery on the parent form's current event:
Me.PageA1.Form.lst2.Requery ?
If PageA1 is not the subform control name, where can I find this?
Thanks in advance.