I have a DBLookUpComboBox and DBGrid connected to the same table with two different data source components. Im trying to narrow the DBGrid results by filtering that datasource with the selected key value from the DBLookUpComboBox. It does filter the grid however when I select a key value it edits the first row with the selected key value in the grid. why is this happening?
procedure TForm1.DBCBtypeClick(Sender: TObject);
begin
showmessage('Book Type: ' + dbcbtype.KeyValue);
dmpub.tbooks.Filter := 'type = ' + quotedstr(dbcbtype.KeyValue);
dmpub.tbooks.Filtered := true;
end;
Everything else is in the properties of the components