Topic: ComboBox values from SQL "if"
Hello friends,
Here i am again sorry
I'm trying to fill a combobox with values from a table called "clients", however, i would like this combobox to show the value of "name" IF the client type is "private" but if the client type is "company" the value listed in the combobox should be "companyname".
I tried to set the combobox properties to {name} {companyname} so they show up both, but it's a bit messy and it would look much nicer if i got it working.
So, in sort of "psuedo code" i am trying something in the lines of the following:
frmAddInfo.ComboBox2.ItemIndex := SQLExecute('SELECT name FROM client WHERE id_client.type = "private''');
But obviously this isn't working, i'm at the wrong end again. If someone could help or guide me in the right direction it would be a great help!
Thanks!