delphi数据库定位getbookmark

procedure Tincasement.Button2Click(Sender: TObject);
var i:integer;
    bm:pointer;
begin
if (messagedlg('确定要取消出箱吗?',mtconfirmation,[mbyes,mbno],0)=mryes)
and(Strtoint(bn.Text)>0)and (strtoint(en.Text)>0)
  then
    begin
      With datafm.outbox do
        begin
          bm:=getbookmark;
          disablecontrols;
          For i:=Strtoint(bn.text) to strtoint(en.text) do
            begin
              First;
              While not eof do
                begin
                  If Fieldbyname('boxnumber').Value=i
                    then
                      begin
                        edit;
                        FieldByName('inout').value:='未出库';
                        post;
                      end;
                  next;
                end;  
            end;
          refresh;  
          enablecontrols;
          gotobookmark(bm);
          freebookmark(bm);            
          showmessage('取消完毕!');
        end;
    end;
end;

你可能感兴趣的:(数据库,Integer,Delphi)