Topic: link text in edBarID (idnummer) with cbOperator in script

Hi, How should I link the text content in edBarID (idnummer) with cbOperator in script? The operators table field names are idnummer, first name, and last name. Thanks in advance.

Re: link text in edBarID (idnummer) with cbOperator in script

A little bit more details would help, we have no idea what you are talking about smile

Re: link text in edBarID (idnummer) with cbOperator in script

Well, I mean the following. Data reference (idnummer) in the textbox must be fully displayed in the combobox (first name, last name, and idnummer. So in this case there are 3 table fields. Should the idnummer text with the correct row are linked. With best regards.

Re: link text in edBarID (idnummer) with cbOperator in script

Hi again,
This code work.

procedure frmAddNewTest_edBarID_OnChange (Sender: string);
begin
         ///////////////////frmAddNewTest.cbOperator.dbItemID := frmAddNewTest.tgOperators.dbItemID ;
         /////////////////SQLExecute ('select idnumber from operators where id = ('+inttostr(frmAddNewTest.tgOperators.dbItemID)+')');

    frmAddNewTest.cbOperator.dbFilter := 'idnumber LIKE "%'+ frmAddNewTest.edBarID.Text +'%"';
    UpdateDatabase('operators');

    if frmAddNewTest.cbOperator.Items.Count = 2 then
    begin
        frmAddNewTest.cbOperator.DroppedDown:=False;
        frmAddNewTest.cbOperator.ItemIndex := 1;
    end else frmAddNewTest.cbOperator.DroppedDown:=True;
end;
-------------------------------------------------
But now when I close and reopen form I receive this error: Cannot focus a disabled or invisible window?

Re: link text in edBarID (idnummer) with cbOperator in script

carlo_dj
I did not find any errors in this code.

Dmitry.

Re: link text in edBarID (idnummer) with cbOperator in script

Hi, the error dialog:  Cannot focus a disabled or invisible window : is fixed. I remove SetFocus event. Thanks