1 (edited by v_pozidis 2017-02-23 13:00:40)

Topic: sort combobox HELP PLEASE!!

I have 2 tables  with relationship.
I want to sort the combobox from the last record to the first.

The combobox has the id_Fakelos from the table is the Ypothesi which has relationship with the table Fakelos, and I like to sort it from the last record to the first.

In the picture you will found some details

Post's attachments

Attachment icon question.png 62.43 kb, 246 downloads since 2017-02-23 

Re: sort combobox HELP PLEASE!!

i used this example
http://myvisualdatabase.com/forum/viewt … 159#p19159

3 (edited by ehwagner 2017-02-23 16:59:08)

Re: sort combobox HELP PLEASE!!

You can also do the following without using script. In the Objector Inspector for the combobox, you can use the filter property to sort the combobox.


https://s7.postimg.org/ybgdqgst7/Sort_Combo_Box_Desc.png

Re: sort combobox HELP PLEASE!!

ehwagner wrote:

You can also do the following without using script. In the Objector Inspector for the combobox, you can use the filter property to sort the combobox.


https://s7.postimg.org/ybgdqgst7/Sort_Combo_Box_Desc.png


thank's this works nice.
Can I do it also using script? because i want to have options to choose

Re: sort combobox HELP PLEASE!!

v_pozidis
Try this:

   Form1.ComboBox1.dbFilter := '1=1 Order By id desc';
   Form1.ComboBox1.dbUpdate;

also please download latest beta version
https://www.dropbox.com/s/xf20ksdbdgj6w … b.zip?dl=0


because method dbUpdate was added in the beta version.

Dmitry.

6 (edited by v_pozidis 2017-02-23 18:25:55)

Re: sort combobox HELP PLEASE!!

DriveSoft wrote:

v_pozidis
Try this:

   Form1.ComboBox1.dbFilter := '1=1 Order By id desc';
   Form1.ComboBox1.dbUpdate;

also please download latest beta version
https://www.dropbox.com/s/xf20ksdbdgj6w … b.zip?dl=0


because method dbUpdate was added in the beta version.

Thank's to all for your help. I have 3.2 ver.do I need to download the beta ?

Re: sort combobox HELP PLEASE!!

v_pozidis
Yes.

Dmitry.