Developing a flexible query builder UI?

I need to develop somekind of flexible database query UI. Some of the things I want to do is offer the option to include column headers, choice of fields to include in the export, the ability to add an additional query criteria to an existing criteria. These are things I’ve seen and are fairly standard. I’ve built some of these as individual queries but this UI will become unweildy. I’m looking for suggestions as to how I might approach this. Thanks.

Hey! Did you develop some of that kind? I’m looking also for a query-generator-UI!

Nope. I developed 4 or 5 query UI’s that covers 98% of their needs. I may return to this but probably something else will always push it down on the list.

I did a long time ago (not in Xojo) and it was too flexible, the users, who have had experience making their own apps in MS Access, were overwhelmed. I wound up developing common queries for them anyway. Since then I have taken Duane’s approach. Users have been much happier and I have less report related IT calls.