如何获取打印按钮的打印次数???
我想获取一个窗口中的打印次数,不知道该如何实现,下面的程序提示"无法编译",大家帮我看一下~~~,ps是一个计数器,获取后再写到数据库里~``procedure MyBeforePrint(ModID: Integer);
var
mr: TModalResult;
Flag: string;
PS: Integer;
begin
Flag := me.cdsMain.FieldByName('ParentXSKPNo').AsString;
PS := 0;
Repeat
PS := PS+1;
DirectExecuteSQL(GlobalConfig.DB.DBName, 'UPDATE tblXSKPMain SET PrintCount=ps WHERE XSKPNo='+
AnsiQuotedStr(Me.cdsMain.FieldByName(Me.ReceiptNoCol).AsString, SQLQUOTEDCHAR));
IF Flag = 'Y'then
begin
mr := MessageDlg('此单据之前已经打印,继续打印吗?', mtConfirmation, [mbYes, mbNo], 0);
if mr = mrNo then Abort;
end;
Until PS=5;
if Me.cdsMain.FieldByName('ParentXSKPNo').AsString <> 'Y' then
DirectExecuteSQL(GlobalConfig.DB.DBName, 'UPDATE tblXSKPMain SET ParentXSKPNo=''Y'' WHERE XSKPNo='+
AnsiQuotedStr(Me.cdsMain.FieldByName(Me.ReceiptNoCol).AsString, SQLQUOTEDCHAR));
end;