Lookup using 2 fields of form as parameters

I am tryn to use this sentence for a SELECT control lookup method.

SELECT timbrado, timbrado
FROM proveedores_timbrados
WHERE vencimiento > ‘{fecha_factura}’ AND ruc = ‘{ruc}’
ORDER BY timbrado

Works Great at insert time on the form, but on update shows black value on the field. There is a workarround or it is a bug?

[SOLVED]

SELECT timbrado, timbrado
FROM proveedores_timbrados
WHERE vencimiento > ‘{fecha_factura}’ AND ruc = ‘{ruc}’
ORDER BY timbrado

​assing variables beforo use it.

SELECT timbrado, timbrado
FROM proveedores_timbrados
WHERE vencimiento > ‘$fecha_factura’ AND ruc = ‘$ruc’
ORDER BY timbrado