Subject Re: [IBO] TIB_Combo and ParamName
Author radevojvodic
OK. Thank You Helen.

There is just one thing that I want to ask. Why does the TIB_ComboBox
have a property paramname if it can't be used. The same parameter in
TIB_Edit works fine. I always expect that properties that are named
same in similar group of components have a same purpose. That is why
I thought it can be done the way I tried.

--- In IBObjects@y..., Helen Borrie <helebor@d...> wrote:
> At 11:50 AM 04-12-01 +0100, you wrote:
> >I have a query with parameters and i want to change the parameter
value with
> >TIB_comboBox. I set up datasource for TIB_ComboBox and in
paramname property
> >i entered correct name of parameter. Current value of parameter is
showed
> >properly but i can not change the value.
> >
> >So, how can i use TIB_ComboBox for updating parameter value of
TIB_Query
>
> That isn't what a TIB_ComboBox is used for. It is a data-aware
control that is used to associate a value from a pick-list with a
**column** in your query.
>
> You have two choices for doing what you want, depending on whether
you want the pick-list to come from a database query or from a set of
hard-coded items.
>
> If the pick-list is coming from a query, use a TIB_LookupCombo,
leaving its Datasource property blank.
> Create a query for populating your pick-list and drop in a
TIB_Datasource for that query. Pick up the list query as the Dataset
property of this datasource.
> Set the Displayfield of the lookupcombo to be the column of the
list dataset that you want to appear in the editbox of the
lookupcombo to indicate selection.
> Then, in the event that triggers the query, pick up the parameter
value from the currently selected row of the list query (read the
dataset, not the control).
>
> If you want to hard-code the items for your pick-list, use an
ordinary TComboBox.
> Then, in the event that triggers the query, pick up the parameter
value from the Text property of the combo box.
>
> Either way, you are going to need a lot of pick-lists!
>
> By the way, your SQL for your main query is ambiguous because you
have not properly identified the table sources for the columns. It
should rather be:
>
> SELECT p.PONUDE_ID
> , p.PONUDE_DATUM
> , p.PONUDE_OPIS
> , p.PONUDE_ODOBREN
> , p.PONUDE_DKO
> , (p.PONUDE_JC * p.PONUDE_BV) AS VRIJED
> , o.OPSTINA_NAZIV
> , q.PROVIDER_SN
> , t.TERSAR_IME
> , v.VRSUSL_OPIS
> FROM PONUDE p
> JOIN OPSTINE o ON (p.PONUDE_OPS=o.OPSTINA_ID)
> JOIN PROVIDER q ON (p.PONUDE_SP=q.PROVIDER_ID)
> JOIN TERSAR t ON (p.PONUDE_TER=t.TERSAR_ID)
> JOIN VRSUSL v ON (p.PONUDE_VU=v.VRSUSL_ID)
> Where (o.OPSTINA_NAZIV Like :opstina) and
> (t.TERSAR_IME Like :saradnik) and
> (v.VRSUSL_OPIS Like :usluga) and
> (p.PONUDE_DKO Between :oddana and :dodana) and
> (p.PONUDE_ODOBREN Like :odobren)
>
> Regards,
> Helen
>
> All for Open and Open for All
> InterBase Developer Initiative ยท http://www.interbase2000.org
> _______________________________________________________