Query Mode > Displaying Query Results > Using Two TData Controls |
Another option is to use two different TData controls: one for entering the query and the other for displaying query results.
To do this, both controls must have the same data source properties, in other words, refer to the same SourceRecordset. One of them has TData1. QueryMode =True permanently, whereas the other has TData2.QueryMode = False. Different bound controls are used to represent the data of the query (controls bound to TData1) and the results (controls bound to TData2).
When you need to apply the query to the second TData control, use the QueryFilter property in the following manner:
Example Title |
Copy Code
|
---|---|
TData2.SourceRecordset.Filter = TData1.QueryFilter |
The QueryFilter property contains the current query (in other words, ADO filter) generated from the data in TData1.
Obviously, you can use QueryFilter to impose the generated filter on any ADO recordset, not necessarily the SourceRecordset of a TData control.