title: Delphi - combo box search in database using sql queries
body: <p>This is the error I get when I run the code below. I'm not too sure what's wrong any help is appreciated</p>
  
  <p><img src="https://i.stack.imgur.com/uVlNS.png" alt=""></p>
  
  <pre><code>procedure TFSearchMember.btnSearchClick(Sender: TObject);
  var buttonSelected:integer;
  WhereTextSelection,WhereFieldSelection:string;
  begin
  
  WhereFieldSelection:=cboWhereField.Text;
  WhereTextSelection:=txtWhere.Text;
  
  adoQuery1.Parameters[0].Value:=WhereTextSelection;
  adoQuery1.Open;
  ADOQuery1.Requery;
  
  txtWhere.Text:='';
  cboWhereField.Text:='';
  
  
    if ADOQuery1.RecordCount=0 then
    begin
      buttonSelected:=MessageDlg('Record not found.', mtError, [mbOK],0);
      if buttonSelected = mrOK then
      Exit;
    end;
  </code></pre>
  
  <p>I also have this in the ADOQuery SQL property</p>
  
  <p><img src="https://i.stack.imgur.com/ZhFkx.png" alt=""></p>