Topic: Is there a way to update the combo boxes?

Hey everyone, i got a from with 3 combo boxes, they have the previous combo box as a parent cb, , lets say they are called:

CB1 , CB2 and CB3

CB1 is the type
CB2 , Brand
CB3 Modelo

In front of each cb, i have a + new form , button, it opens a new form that allows me to add a new type, brand or model, but if i do so i have to "reset" the previous combo box in order to select the new item in the new combo box.
Is there a way to counter this?

Re: Is there a way to update the combo boxes?

You can call method DoOnChange for parent combobox to update child combobox and use event OnAfterClick for button with action "New Record"

procedure Form1_ButtonNewRecord_OnAfterClick (Sender: string);
var
    iID: integer;
begin
    iID := Form1.CB2.dbItemID; // to save selected id
    Form1.CB1.DoOnChange;
    Form1.CB2.dbItemID := iID; // to restore selected item
end;
Dmitry.

Re: Is there a way to update the combo boxes?

let me try wink

Re: Is there a way to update the combo boxes?

Don't know why but... list out of bounds...

Re: Is there a way to update the combo boxes?

Please paste your script here.

Dmitry.

Re: Is there a way to update the combo boxes?

i deleted it, but i'll rewrite it again as soon as i have time, i am using a "clear" funcion like: dbitemid = 0 for each combobox, this way i'll have to re choose everything again anyway