Podrias utilizar este codigo, recuerda que tienes que poner un edit y botton:
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add(' select id_documento,numero_doc, nombre, apellido, id_piso, id_destino,fecha_entrada,hora_entrada from visitantes where numero_doc='#39+edit2.Text+#39);
ADOQuery1.open;
if ADOQuery1.Eof then
begin
ShowMessage('Este Numero de Documento No existe');
edit1.Clear;
SetFocus;
end;