More on qbe question

jedaworks

Member²
The following test code gets all the records in the database when the button is first clicked. When the button is clicked again, the records that meet the qbe criteria are selected. How can I make the qbe get the correct records on the first click?

procedure TfrmEquipment.Button2Click(Sender: TObject);
begin
dsEquipment.Open;
dsEquipment.QBEMode := True;
dsEquipment['Eqnum'] := '0000122%';
dsEquipment.ExecuteQBE;
end;
 
I tried this, and it turns out that the Open function causes this behaviour. If you replace dsEquipment.Open with dsEquipment.Active := True it works as expected. We will look into this problem, but at least there is a work around.

Note that you should set QBEMode to True before activating it. This will prevent an unnecessary initial query.

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