|

楼主 |
发表于 2008-2-5 09:50:05
|
显示全部楼层
我贴在主数据集onfieldchange事件下的代码
我贴在主数据集onfieldchange事件下的代码:
unit YWXX1;
interface
uses
Business.System, Business.Model, Business.Data;
type
TYWXX1 = class(TInfo)
DataSetZB: TSQLDataSet;
DataSetCB: TSQLDataSet;
procedure DataSetZBFieldChange(DataSet: TDataSet; Field: TDataField);
private
{private declarations}
public
{public declarations}
end;
implementation
procedure TYWXX1.DataSetZBFieldChange(DataSet: TDataSet; Field: TDataField);
var
fieldID:string;
begin
fieldID:=DataSetZB.fieldbyname('CPID').asstring;
if field.fieldname='CPID' then
begin
DataSetCB.close;
DataSetCB.sql.clear;
DataSetCB.sql.text:='select distinct(PZX),PZMC from CPLBPZB where CPID='+fieldID+'';
DataSetZB.OPEN;
DataSetCB.OPEN;
end;
end;
end. |
|