Thank you for your fast answers. I am not sure how to use the IndexIf(...)
this is my the code:
Begin
stringsold_id := ListViewSold.Selected.Caption;
Form2.connectDB;
Form2.SQLQuery3.SQL.Text := 'SELECT * from customer, sold WHERE customer.customer_id = sold.customer_id;
Form2.SQLQuery3.Open;
stringCutsomer:= Form2.SQLQuery3.FieldByName('customer_id').AsString;
intCustomer:= StrToInt(stringCutsomer);
Combo1.Items.IndexOf(intCustomer);
Error: Incompatible type for arg no. 1: Got "LongInt", expected "AnsiString"
It looks like you are doing things the hard way. I have no idea what exactly you are trying to accomplish, the info you shared is not enough, for me to realize, what you need to do, so, I'm going to address the problem at hand, which, I suspect, is not going to produce the expected results.
Any way.
IndexOf() takes a string as a parameter not an integer, try using
Combo1.Items.IndexOf(stringCustomer)
instead and see if that takes you to your expected destination.