请指教!!!
begin
with ADOTableStore do
begin
first;
while not eof do
begin
if((edit1.Text=fieldbyname('StorehouseID').AsString) and (edit2.Text=fieldbyname('Sbin').AsString)) then
begin
ShowMessage('该位已经存货,请选择别的货位!');
edit1.Text:='';
edit2.Text:='';
end;
begin
ShowMessage('信息填写不完整!')
end
else
begin
edit;
append;
fieldbyname('StorehouseID').AsString:=edit1.Text;
fieldbyname('Sbin').AsString:=edit2.Text;
fieldbyname('ItemID').AsString:=edit3.Text;
fieldbyname('Sfrom').AsString:=edit4.Text;
fieldbyname('SIntoQty').AsString:=edit5.Text;
post;
Refresh;
showmessage('存货成功!');
end;
end;
next;
end;