Subject Re: [IBO] IB_Combobox as Parameter editing control
Author Helen Borrie
At 05:54 PM 3/05/2003 +0200, you wrote:
>Hello,
>
>I filled
>
>IB_Combobox.items with customer names
>
>and
>
>IB_Combobox.itemValues with their customer numbers.
>
>IB_ComboBox.style:=csDropDownList;
>IB_ComboBox.dataSource:=IB_DataSourceTableXY;
>IB_ComboBox.ParamName:=CustomerNumber;
>
>IB_DataSourceTableXY.dataSet:=IB_Query;
>
>IB_Query.SQL : select * from tableXY where CustomerNumber=:CustomerNumber;
>IB_Query.open;
>
>With this configuration I can't set the Param 'CustomerNumber' and I receive
>an empty Query.
>
>What's wrong?

Ulrich,
I've bumped into this problem, too. I don't think this is implemented as
fully as it might be. It should work if you add these two pieces of
handler code:

procedure TForm1.IB_ComboBox1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ib_query1.Open;
end;

procedure TForm1.IB_ComboBox1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
with ib_query1 do
begin
if Active then Close;
ParamValues['CustomerNumber'] := '';
if not Prepared then Prepare;
end;
end;

Try it, and see whether it works for you...

cheers,
Helen