K
kent100
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure Tfrmaddjh.Button1Click(Sender: TObject);
var
i:integer;
begin
i:=000;
frmscjdjh.ListBox1.Items.add(edit1.text);
table1.open;
table1.append;
table1.fieldbyname('dm').asstring:=copy((_sysyear+_7DDwdm),1,10)+inttostr(i);
table1.fieldbyname('mc').asstring:=edit1.text;
table1.Post;
table1.close;
showmessage('添加计划成功');
frmaddjh.close;
i:=i+1;
end;
我知道我的方法是错误的,因为每次i都被重置为000了,但我不知道如何改,
才能使流水号自动增加。
请各位帮忙看看。
注:i 为一个三位的流水号,最好能控制000-999最好。
var
i:integer;
begin
i:=000;
frmscjdjh.ListBox1.Items.add(edit1.text);
table1.open;
table1.append;
table1.fieldbyname('dm').asstring:=copy((_sysyear+_7DDwdm),1,10)+inttostr(i);
table1.fieldbyname('mc').asstring:=edit1.text;
table1.Post;
table1.close;
showmessage('添加计划成功');
frmaddjh.close;
i:=i+1;
end;
我知道我的方法是错误的,因为每次i都被重置为000了,但我不知道如何改,
才能使流水号自动增加。
请各位帮忙看看。
注:i 为一个三位的流水号,最好能控制000-999最好。