1 (edited by FMR 2022-05-02 00:18:47)

Topic: How to read integer value from ComboBox ?

Hello,

How to complete this code to make it a possible to work ?

Form1.Edit1.Value :=  Form1.ComboBox1.????


I have stored a number of years on table as integer value and then I need read the years that appear on combobox as Value

not easy like handling the data as string Form1.Edit1.Text :=  Form1.ComboBox1.Text;

Life is like a school;
One can learn and graduate or stay behind.

Re: How to read integer value from ComboBox ?

Hi,
Try it like this

procedure form1_ComboBox1_OnChange (Sender: TObject);
begin
  form1.edit1.value := strtoint(form1.combobox1.text);
end;

Derek

Re: How to read integer value from ComboBox ?

derek wrote:

Hi,
Try it like this

procedure form1_ComboBox1_OnChange (Sender: TObject);
begin
  form1.edit1.value := strtoint(form1.combobox1.text);
end;

Derek

Derek Superhero !

Thanks a lot, worked perfectly, sorry for my stupid questions, I learn the SQL and scripting in the last 2 month

Life is like a school;
One can learn and graduate or stay behind.