Resumiendo:
El codigo que tengo eb MyQuery:
Código SQL
[-]SELECT codigo,stock,stockminimo
FROM articulo
WHERE codigo=:codigo // Lo paso como parametro
En mi boton:
Código Delphi
[-]MyQuery.Close;
if not MyQuery.Prepared then MyQuery.Prepare;
MyQuery.ParamByName('codigo').DataType := ftInteger;
MyQuery.ParamByName('codigo').AsInteger := StrToInt(txtcodigo.text);
MyQuery.Open;
Saludos