//
procedure TDocuInput
begin
adoquery
adoquery
adoquery
adoquery
adoquery
end;
//
procedure TDocuInput
begin
datasource
end;
//
procedure TDocuInput
var
sumoutput
i:integer;
begin
suminput:=
sumoutput:=
//統計借貸雙方的數額
for i:=
if (stringgrid
begin
suminput:=suminput+strtofloat(stringgrid
sumoutput:=sumoutput+strtofloat(stringgrid
end;
dbedit
dbedit
end;
procedure TDocuInput
begin
SumAccount;
end;
//
procedure TDocuInput
begin
stringgrid
stringgrid
stringgrid
stringgrid
stringgrid
end;
//
procedure TDocuInput
ARow: Integer; var CanSelect: Boolean);
begin
//防止在輸入數據時上面有空行
if stringgrid
begin
showmessage(
exit;
end;
//保存選取的單元行列值
curRow:=ARow;
curCol:=ACol;
if (curCol<=
stringgrid
//防止選中標題欄
if ARow=
//統計借貸雙方信息
sumAccount();
end;
[
From:http://tw.wingwit.com/Article/program/Delphi/201311/25018.html