Subject | RE: [IBO] Cannot get TIB_LookupCombo to work as expected .. I know its my fault! |
---|---|
Author | Adrian Wreyford |
Post date | 2004-11-20T11:14:36Z |
Thanks Helen ..I did say you will have to be patient.
Remember, in IBO, datasets drive controls, not the other way around as in
the VCL model.
Yes
Link the TIB_LookupCombo's Datasource property to the TIB_Datasource of
your Location query.
OK
Pick the field you want to display in the editbox part of the control as
DisplayField.
Yep done
Everything else happens on the dataset of the Location query.
Well that is where I got to before posting this.
Now I need, to see the location once selected inserted into ANIMAL.
I'm using a form with many IB_Edits, and not a Grid to display records form
ANIMAL, with a IB_Update Bar
KeySource/Lookup relationship.
OK
relationship.
Don't understand. You see I can use the VCL DBLOOKUPCOMBO, to insert values
from the lookup into the master.
I thought this is what you would use TIB_LOOKUPCOMBO for, or how else would
I get the data from a lookup list into the animal table.
lookup relationship. That is, the primary key of the lookup table, e.g.
LocationID, points to a polling key in the main table - the "Keysource"
table - which is designed (by you) to point to the location. It can be that
many Animal records would point to the same LocationID through this lookup
key.
If that is what you want to implement, then proceed like this with the
Location query object, assuming that the name of the key is LocationID.
Do as I described earlier with the Datasource and DisplayField properties
of the control.
YEP
For the KeySource property, select the Datasource (must be a
TIB_Datasource) that points to the main table.
OK
For the KeyLinks property, type in
LOCATIONID=ANIMAL.LOCATIONID
DONE
If you want the ability to type in some characters of the Location
description (the DisplayField) and have the mechanism find the key, set
KeySeeking true (I think it is the default, anyway).
Now, if you want to go further, and link up the lookup dataset's
description field, ie. the DisplayField, to a derived field in main
dataset, you use KeyDescLinks as well. There is more to this and I won't
waste space and time if you don't need this (i.e. you only want to use the
LocationID in the main dataset).
THIS IS WHAT I NEED
PLEASE ELABORATE.
Lastly, if you want to, you can proceed to embed the lookupcombo in the
grid. To do that, select it and cut it out using Ctrl-X. Then, select the
grid by clicking in it, and do Ctrl-V to drop the control into the
grid. Then, when you run your program, the lookupcombo will appear in
place of the polling key field when that field gets focus in dssEdit or
dssInsert and you will be able to select a value for LocationID in the main
dataset.
I don't want it on a grid.
I have a form and tab around to enter the data then post, and want to force
the user to use location for animal record from the location table, as one
would using a stinglist in IB_ComboBox.
Thanks
[Non-text portions of this message have been removed]
Remember, in IBO, datasets drive controls, not the other way around as in
the VCL model.
Yes
Link the TIB_LookupCombo's Datasource property to the TIB_Datasource of
your Location query.
OK
Pick the field you want to display in the editbox part of the control as
DisplayField.
Yep done
Everything else happens on the dataset of the Location query.
Well that is where I got to before posting this.
Now I need, to see the location once selected inserted into ANIMAL.
I'm using a form with many IB_Edits, and not a Grid to display records form
ANIMAL, with a IB_Update Bar
>How many IB_Queries do I need.?It's not a Master child relationship. It is what is referred to as a
>
>How do I set up the Master child relationship?
KeySource/Lookup relationship.
OK
>How does the loopupCombo know to insert the data into IB_QueryAnimal onceIt doesn't. You can't use a TIB_LookupCombo to implement a master-detail
>the selection has been made .. I cannot find a way to bind it to ANIMAL.
relationship.
Don't understand. You see I can use the VCL DBLOOKUPCOMBO, to insert values
from the lookup into the master.
I thought this is what you would use TIB_LOOKUPCOMBO for, or how else would
I get the data from a lookup list into the animal table.
>Just get it to display the lookup data, but with no effect on animal.Please explain exactly what you want. The TIB_LookupCombo implements a
lookup relationship. That is, the primary key of the lookup table, e.g.
LocationID, points to a polling key in the main table - the "Keysource"
table - which is designed (by you) to point to the location. It can be that
many Animal records would point to the same LocationID through this lookup
key.
If that is what you want to implement, then proceed like this with the
Location query object, assuming that the name of the key is LocationID.
Do as I described earlier with the Datasource and DisplayField properties
of the control.
YEP
For the KeySource property, select the Datasource (must be a
TIB_Datasource) that points to the main table.
OK
For the KeyLinks property, type in
LOCATIONID=ANIMAL.LOCATIONID
DONE
If you want the ability to type in some characters of the Location
description (the DisplayField) and have the mechanism find the key, set
KeySeeking true (I think it is the default, anyway).
Now, if you want to go further, and link up the lookup dataset's
description field, ie. the DisplayField, to a derived field in main
dataset, you use KeyDescLinks as well. There is more to this and I won't
waste space and time if you don't need this (i.e. you only want to use the
LocationID in the main dataset).
THIS IS WHAT I NEED
PLEASE ELABORATE.
Lastly, if you want to, you can proceed to embed the lookupcombo in the
grid. To do that, select it and cut it out using Ctrl-X. Then, select the
grid by clicking in it, and do Ctrl-V to drop the control into the
grid. Then, when you run your program, the lookupcombo will appear in
place of the polling key field when that field gets focus in dssEdit or
dssInsert and you will be able to select a value for LocationID in the main
dataset.
I don't want it on a grid.
I have a form and tab around to enter the data then post, and want to force
the user to use location for animal record from the location table, as one
would using a stinglist in IB_ComboBox.
Thanks
[Non-text portions of this message have been removed]