如何直接跳转到指定的数据记录,用什么函数呀,在线

解决方案 »

  1.   

    moveby(50);locate('fieldname','value',[]);
      

  2.   

    if not table1.locate('字段名',‘值’,[]) then
     showmessage('没找到!')
      

  3.   

    ADOQuery1.RecNo:=你指定的记录数
    或者
    ADOQuery1.Locate(FieldName,LocateValue,[loCaseInsensitive]);
      

  4.   

    with CustTable do
      Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '408-431-1000']), [loPartialKey]);或者procedure TForm1.Button1Click(Sender: TObject);var
      V: Variant;
      C: Integer;
      A: String;
    begin
      V := Table1.Lookup('Company;State',
        VarArrayOf(['Blue Sports', 'OR']),
        'CustNo;Addr1');
      if not (VarType(V) in [varNull]) then begin
        C := V[0];
        A := V[1];
        ShowMessage(IntToStr(C) + #10 + A);
      end
      else
        ShowMessage('Search unsuccessful!');end;或者withTable1 dobegin
      { This is the safe way to change 'CustNo' field }
      FindField('CustNo').AsString := '1234';
     { This is *not* the safe way to change 'CustNo' field }
      Fields[0].AsString := '1234';end;