Question about use database.getSQL(foundset)

Hi,
I have a form. One of the fields has a value list based on a relationship. When I use database.getSQL(foundset) I couldn’t get the sql of the relationship. What I need is to get the complete sql that shows the same results as the list displaying on the form. Is there a way to do this or I should use database.getSQL(foundset) and database.getSQL(relation.foundset) and then use these two sqls to make up the final query?

Thanks,

Try this:

database.getSQL(foundset.relation)

It returns the sql for the relation.

Rob