How to pass a complex custom query that spans multiple tables to forms or forms2?

Hello,

how do I pass a custom complex query to forms2?

A complex query that spans multiple tables.

I want to pass this result to a form. Can I do that?

I used to pass the whole table but that is not what I need in my case.

Thank you,

bugaian.