Topic: ComboBox Filter with Variable or ObjectID Value

Hi, how are you?

I am working on a project and I need to specify a combobox filter, I need it to show only the records belonging to the parent table. I am trying to use the dbIndex Value from a TableGrid, also I tried with a variable (string and integer), I think the error is in the syntax that I am using for the filter value. I have attached an image to this question, probably it explains it better.

How can I specify a variable for the Filter property in the combobox? or How can I use the TableGrid1.dbItemID value in the Filter property of the combobox?

Thanks for your help...

Have a Blessed Day...

Post's attachments

Attachment icon idtablecompanyfilter.png 38.17 kb, 106 downloads since 2020-08-31 

Re: ComboBox Filter with Variable or ObjectID Value

I think you should do it with sql script something like

Combobox.dbSQLExecute('SELECT id,name FROM customer where id_company='+IntToStr(frmWelcome.TableGrid1.dbItemID))

and place it on the OnShow of the form.

brian

Re: ComboBox Filter with Variable or ObjectID Value

Thanks indeed. I appreciate it your answer, the only thing is that I really want to learn how to include a variable in the filter property for an item... It will be useful for multiple tasks in my project.

Re: ComboBox Filter with Variable or ObjectID Value

I think passing object value to combobox filter is not yet supported. I've used the dbSQLExecute and/or changing Combobox.dbFilter via script in my projects.

brian