我想要限制游标移动在指定范围内,如在字段“科目”的“语文”和和字段“考试时间”的“2000-3-1”之内,以下语句不行,怎样修改?
if ( adotable3['科目']=DBLookupComboBox2.text and adotable3['考试时间']   =DBLookupComboBox3.text) then
        
adotable3.Prior;

解决方案 »

  1.   

    if ( adotable3['科目']=DBLookupComboBox2.text) 在这加右括号and (在这加左括号adotable3['考试时间']   =DBLookupComboBox3.text) then
            
    adotable3.Prior;
      

  2.   

    if (ADOTable1.FieldByName('科目').AsString=DBLookupComboBox2.text) And 
       (ADOTable1.FieldByName('考试时间').AsString=DBLookupComboBox2.text) Then
    ADOTable1.Prior;
      

  3.   


    procedure TForm1.Button2Click(Sender: TObject);
    var
      rtForm:TRect;
    begin
      if Flag = False then
      begin
      rtForm:=Form1.BoundsRect ;
      ClipCursor(@rtForm);
      Button1.Enabled :=False;
      Button2.Enabled :=False;
      Button3.Enabled :=True;
      Flag:=True;
      end;
    end;