Topic: Combobox and default index

Hello Dmitry,
I am starting a small project to collect names of teachers and what country / region they are based in.
I have a form (form4) with 2 comboboxes, one of which is a parent combobox.
90% of teachers are based in England so I set the default index for combobox1 = 1 ('England') and the User can go directly to combobox2 to select a region.  But instead of displaying the regions for England in combobox2, no values are displayed (screenshot 'combobox no values').  So the user has to return to combobox1, reselect 'England' from the combobox1 values and only then are the values for combobox2 displayed (screenshot 'combobox with values').
Is this the correct way to use the default index or am I making an error?
I have attached a copy of the project and I am using Version 1.51.
Thanks,
Derek.

Post's attachments

Attachment icon NUT Dmitry.zip 469.7 kb, 478 downloads since 2015-04-20 

Re: Combobox and default index

Hello,


You should create event OnShow for Form4

procedure form4_OnShow (Sender: string; Action: string);
begin
    if Action='NewRecord' then form4.ComboBox1.DoOnChange;
end;
Dmitry.

Re: Combobox and default index

Hi Dmitry,
Working correctly now.
Thanks,
Derek.