Scrolling after QBE

Werner

Member
I have a problem using QBEMode in a Master-Detail form. After executing QBE in the detail- dataset I return to the mastersector and scroll to the next record.
Now the detaildataset uses the last executed QBE again and shows only the preselected detailrecords(if existing). How can I cancel the detailQBE while scrolling the masterdataset?

hopeful
Werner
 
The QBE feature modifies the SQL and variables, so when you change the master record, the same QBE criteria will be applied to the detail records. There is no specific function to clear the QBE criteria, so you have to use the following code when the master dataset scrolls:
Code:
with DetailDataSet do
begin
  QBEMode := True;
  for i := 0 to FieldCount - 1 do Fields[i].Clear;
  ExecuteQBE;
end;
Note that this will generate an extra query as you scroll in the master dataset.

------------------
Marco Kalter
Allround Automations
 
Back
Top