Retrieving 'Child' Rows
Posted on 2004-11-29
I have a database with a table (tblEmployees) that stores employees details. It is linked to a table called tblDocumentArchive that stores information about employee documents (ie contract, appraisals etc). The information stored are things like document title, create date etc. They are linked as a 1-many relationship by EmployeeNumber.
I have a .NET form that has an OleDbConnector, Adapters as necessary, and a Dataset (dsEmpDocs) that has both the above tables within it. I have created a datagrid (grdEmp) on my form that is populated with employee names at run time. (I use Me.adptEmployees.Fill(dsEmpDocs) to populate the list) All my other fields are populated with the employee details and as I moved through the list of employees, so the data changes in each field - as expected.
However, I have another datagrid (grdEmpDocs) that lists (or should anyway) each document that is 'attached' to the current employee, but when I move through my employees in grdEmp, my list of documents doesn't get refreshed (all the other data does)
How can I get my second grid to refresh with the first? I have been going around in circles trying everything programmatically with examples, or everything graphically with a few lines of code, and I think I have just confused myself as to where I am now.