I´m doing a report in a dinamically way trying to change th SQL statement, but I get this error:

---> Invalid procedure call or argument. <---

This is the code I´m using:

ctrl2001.Commands("Pedetall").CommandText = "SELECT * FROM_ T1PED ORDER BY Inicio_Ped"

ctrl2001.Commands("Modelos").CommandText = "select * from_ T2MOD "

and this is my data environment:
ctrl2001-
-Pedidos -
-SQL(Pedetall)
- fields
- fields
-SQL(Modelos)
- fields
- fields

if I put the SQL statements directly in the properties of each command the report work just fine but in the moment I try to doit dinamically it crash.

Any Ideas.

Thanks