I have a very simple application with two tables, ParentTable
and ChildrenTable
. Each child in the table has a foreign key to a parent (parent-child relationship is one-to-many).
When I display a form with parent info, I want to display a ListBox with all the parents children.
I already got a ListBox that displays all the children, but I'm not sure how to change the query so that I see only the active parents children (the parent which I am looking at its form right now). It goes like this:
SELECT ChildrenTable.IdNumber, ChildrenTable.FirstName, ChildrenTable.LastName FROM ChildrenTable ORDER BY [FirstName];
I guess I'm looking for something like:
WHERE ChildrenTable.ParentIdNumber == <active parent>.IdNumber