Hi George
I´m doing the following:
'select * from clients where name=?thisform.lcname'
I´ve created a propertie in my form, the initial value is (none) or wathever you want,and I have a method in all my forms that I´ve called update_cursors(), I call this method each time that I want to move to the next record or when I want to refresh my querys. In that method I write the necessary code to requery all cursors that I need refresh. For example:
thisform.lcName= consult.name
select clients
requery()
consult could be a cursor with all client's keys for example.
thisform.lcKey= consult.key
select clients
requery
select Clients_invoices
requery
you can write in clients invoice the following:
'select * from clients_invoices where key =?clients.key'
I prefer to use like instead = because you can use "%"
'select key from clients' && alias consult
'select * from clients where name=?thisform.lcname'
'select * from clients_invoices where key like ?clients.key'
'select * from clients_invoices_details where key like ?clients_invoices.key'
so the code in the method could be:
&&&method update_cursors()
select consult
thisform.lcKey= consult.key
select clients
requery()
select Clients_invoices
requery()
select Clients_invoices_details
requery()
As you can see consult has the all keys of clients, you can optimize the code with a parameterized query or a query by example to get the cursor consult and you can move trought consult with skip or skip -1 or go bottom or go top and executing the method.
select consult
skip
thisform.update_cursors()
I hope this example can help you.
Regards
Carlos Miranda
Carlos A. Miranda
E.I.S.lnc
President