Topic: dbFilter not working!
Hi everyone,
I just have a problem with dbFilter in both Grid and combobox!!!
I want to filter results based on customer id. so Combo box or grid will show only records related to customer and not all of them.
I just want to do it in separate window (form) so I have to do that using scripts but its not working:(
if I write the filter manually in filter field of grid it will works but using script not working.
here is my script for both:
procedure Payment_OnShow (Sender: TObject; Action: string);
begin
//Payment.ComboBox1.dbFilter := 'id_customers = ' + IntToStr(Payment.Save.dbParentTableId);
Payment.ComboBox1.dbFilter := 'id_customers = 4';
end;
procedure Payment_OnShow (Sender: TObject; Action: string);
begin
//Payment.TableGrid1.dbFilter := 'id_customers = ' + IntToStr(Payment.Save.dbParentTableId);
Payment.TableGrid1.dbFilter := 'id_customers = 4';
end;
how can I make it work?
I need one of them no matter which one.
There is a table called booking, I want to show all bookings related to customer in grid/combobox and select one of them in payment form to be able to add a payment for that certain booking.
Many many thanks