Sorry,
Here's the code in the when event of the checkbox:
thisform.refresh()
thisform.getemployees()
and the GetEmployees method of the form, which populates the second grid:
local ldStartdate,ldEnddate,laDepts(1),lcDeptlist,tcAlias,lcCommand
thisform.grdEmployees.RecordSource=""
ldStartDate=thisform.mindate
ldEnddate=thisform.maxdate
if used('curEmployeelist')
use in curEmployeelist
endif
if vartype(thisform.deptfilter)<>"C"
thisform.deptfilter=""
endif
select distinct .f. as lselect,tcrec.dwrntdte,tcrec.cdeptid,emplinfo.cemplid,;
alltrim(upper(emplinfo.cempllName))+', '+alltrim(upper (emplinfo.cemplfname))+' '+ alltrim(upper(emplinfo.cemplmname)) as cname;
from emplinfo;
join tcrec on left(cJobid,10)=emplinfo.cemplid;
join curOTDepartments on curOTdepartments.cdeptid=tcrec.cdeptid;
into cursor curEmployeelist;
where curotDepartments.lselect=.T.;
AND between(tcrec.dwrntdte,ldSTartdate,ldEnddate);
Group by emplinfo.cemplid
select curEmployeelist
USE (DBF("curEmployeelist")) IN 0 AGAIN ALIAS TEMP
USE IN curEmployeelist
USE (DBF("TEMP")) IN 0 AGAIN ALIAS curEmployeelist
USE IN ("TEMP")
SELECT curEmployeelist
CURSORSETPROP("BUFFERING",1)
index on cdeptid tag cdeptid
index on cemplid tag cEmplid
index on cname tag cname
set order to cname
lcFilter=thisform.deptfilter
set filter to &lcFilter
thisform.grdEmployees.recordsource="curEmployeelist"
thisform.refresh()
return
Robert J. Ohrstedt
RJO Associates