Topic: ComboBox Filter 2

I vaguely remember that I posted something similar before but I just couldn't find it. Perhaps I remember wrong.


I wanted to use a combobox as filter for a specific grid. I got one of Derek's sample project where combo values entered into DB file which works fine. I wanted to have combo values in script as I delete and start with blank DB file many times in the course development process. It works fine on source form (SaleInvItem) but couldn't get it working on Form1, where it'd be used as a filter.


Please see the attached sample project.

Post's attachments

Attachment icon ComboFilter2.zip 19.52 kb, 374 downloads since 2018-01-09 

Adam
God... please help me become the person my dog thinks I am.

Re: ComboBox Filter 2

I can't recommend to use this way. You should write a script with SQL query to add records to dictionary table if you have blank database.

Example:

procedure Form1_OnShow (Sender: string; Action: string); //when you first start, place the cursor in tablegrid and click button to get related transactions
begin
  if SQLExecute('SELECT COUNT(id) FROM DbCr')='0' then
  begin
      SQLExecute('INSERT INTO DbCr (dbcr) VALUES ("Sale"), ("Refund"), ("Other")');
      UpdateDatabase('DbCr');
  end;
end;
Dmitry.