I have 2 recordsets. One called customers (the parent), the other called invoices.(the child)
I want to be able to move my keyboard up and down arrows or click the mouse on a particular row of the parent and have the child move to that row.
For example if I had 2 customers in the parent flex grid, when the current row is "Smith" I would like to see all invoices for Smith in the child grid and then if I move my down arrow on the keyboard to move the customer to "Jones" then I would like to see the invoices for Jones on the child grid.
I have managed to do most of this with the following code:
rsSearch.Open "SHAPE {select LastName,FirstName,HomeTel, from Customers where LastName = """+txtsearch.text+""" order by LastName} AS ParentCMD APPEND ({select ,CustId,datein,EmpId,jobnum,Notes,status,Store from Invoices Order by CustId } AS ChildCMD RELATE CustId TO CustId) AS ChildCMD", dbCTS, adOpenStatic, adLockOptimistic
Set fMainForm.grdSrchCust.DataSource = rsSearch
Set fMainForm.grdSrchInvoices.DataSource = rsSearch("ChildCMD"
.UnderlyingValue
The code above displays the customer record in the customer flexgrid and his invoices in the child grid but I do not know how to move up and down in the customer recordset. I can use move.next or moveprevious and that works but I thought that clicking on a row would do that? Do I have to add code to have it respond to clicking on a row or to have it respond to a keyboard up or down arrow? If so, which event should I put it in?
Hope this is clear.
Thanks,
Dan
I want to be able to move my keyboard up and down arrows or click the mouse on a particular row of the parent and have the child move to that row.
For example if I had 2 customers in the parent flex grid, when the current row is "Smith" I would like to see all invoices for Smith in the child grid and then if I move my down arrow on the keyboard to move the customer to "Jones" then I would like to see the invoices for Jones on the child grid.
I have managed to do most of this with the following code:
rsSearch.Open "SHAPE {select LastName,FirstName,HomeTel, from Customers where LastName = """+txtsearch.text+""" order by LastName} AS ParentCMD APPEND ({select ,CustId,datein,EmpId,jobnum,Notes,status,Store from Invoices Order by CustId } AS ChildCMD RELATE CustId TO CustId) AS ChildCMD", dbCTS, adOpenStatic, adLockOptimistic
Set fMainForm.grdSrchCust.DataSource = rsSearch
Set fMainForm.grdSrchInvoices.DataSource = rsSearch("ChildCMD"

The code above displays the customer record in the customer flexgrid and his invoices in the child grid but I do not know how to move up and down in the customer recordset. I can use move.next or moveprevious and that works but I thought that clicking on a row would do that? Do I have to add code to have it respond to clicking on a row or to have it respond to a keyboard up or down arrow? If so, which event should I put it in?
Hope this is clear.
Thanks,
Dan