How to filter automatically a query?

We've a report that iterates a table called "orders". We've also a table called "addresses" that has multple addresses for each customer of these orders.

We want to get a report that lists some orders with the specific address that the customer chose. So, we have an ADOQuery inside the fr3 file: select * from address where id = :addorder

And addorder is a parameter that is linked with <frxOrder."address"> (a field of the orders table). The first day it worked fine: for each row, FastReport refreshed the query to get the correct address. But the next days it stopped working: it got the address for the first order and then it didn't refresh the query.

We solved it by refreshing manually the query on the "onBeforePrint" event of the band; but, how can we do that automatically? (in fact, first day it worked without manual refresh).

Best Regards

David Rodr?­guez

Comments

  • edited 2:36AM
    davidrgh wrote: »
    ...
    but, how can we do that automatically? (in fact, first day it worked without manual refresh).
    Check if you set a "slave" ADOQuery.Master property. It should point to your frxOrder ADOQuery.

Leave a Comment