T
Ted
I have the basic one-to-many relationship that I would like to display on a
form/subform using a listbox.
I would like a listbox to display all the child records on the subform
(basically only one key field). The user should be able to select the item
in the listbox and the other controls on the subform need to synchronize to
the correct child record.
I've tried the following query in the list box's row soruce to no avail:
SELECT ChildTable.ID, ChildTable.Title FROM ChildTable;
But it lists ALL the child records, and is not dependant upon the current
parent record in the main form. What I would like is only the child records
pertinent to the current parent record to show [in the list box] and all
subform fields to be blank if no child records exist.
I'm sure that this is a common scenario but I can't find any tutorials or
posts that are more explicit beyond a proper SQL statement.
- Do I need to use an SQL statement for both the subform AND the listbox?
- If the SQL statement returns all rows, how does the form know what to link
on?
- How can I filter to display only the child records for the parent
record displayed on the main form?
TIA
form/subform using a listbox.
I would like a listbox to display all the child records on the subform
(basically only one key field). The user should be able to select the item
in the listbox and the other controls on the subform need to synchronize to
the correct child record.
I've tried the following query in the list box's row soruce to no avail:
SELECT ChildTable.ID, ChildTable.Title FROM ChildTable;
But it lists ALL the child records, and is not dependant upon the current
parent record in the main form. What I would like is only the child records
pertinent to the current parent record to show [in the list box] and all
subform fields to be blank if no child records exist.
I'm sure that this is a common scenario but I can't find any tutorials or
posts that are more explicit beyond a proper SQL statement.
- Do I need to use an SQL statement for both the subform AND the listbox?
- If the SQL statement returns all rows, how does the form know what to link
on?
- How can I filter to display only the child records for the parent
record displayed on the main form?
TIA