Subject RE: [IBO] Helen .. perhaps this is clearer
Author Adrian Wreyford
"write a value"



Yes. I want to populate a field in a record ie

I think you DO actually want to implement a Keysource/Lookup relationship.

That's correct.

Guessing...

create table animal (
animalID integer nn pk,
species integer,
.....,
locationID integer)

create table location (
locationID integer nn pk,
description varchar(20))


>Location could have values eg: here, there, anywhere.

LocationID Description
1 here
2 there
3 anywhere

animalID LocationID
1 1
2 1
3 2
4 3
5 1
6 3
7 2

EXACTLY WHAT I WANT TO DO!


Now to use it as a stand alone control .. that it!
It can be used this way. It's just as I described in the earlier message,
except you don't drop it into a grid - use it as a stand-alone control, in
place of the tib_edit you would otherwise have there.

>How would you suggest I go about this.

Suppose qrAnimal has this SQL :

select
a.animalID,
a....,
a.locationID,
(select L.description from Location L
where L.LocationID = a.LocationID) as Loc_Name
from Animal a
where....whatever



Now Helen : This is where I have made the mistake!!!!

a.locationID,
(select L.description from Location L
where L.LocationID = a.LocationID) as Loc_Name



I just had

Select

a.animalID,

a..,

a.locationID

From animal a

Where .. Whatever.



If I have a lot of lookupcombos, to populate fields, do they all have to be
worked into the SQL of the query like this.

A pity this could not just be implemented with a property!




Suppose qrLoc has this SQL:
select
LocationID,
Description
from Location

Right. Drop in the two datasources, dsAnimal hooked to qrAnimal, dsLoc
hooked to qrLoc.

Drop in the tib_lookupcombo. Set its datasource to dsLoc, set DisplayField
to Description.

Now, move to qrLoc.

KeySource: dsAnimal
KeyLinks: LocationID=qrAnimal.LocationID
KeyDescLinks: Description=Loc_Name
KeySeeking := True

Now, qrAnimal:
KeyLinks: AnimalID
RequestLive: True

Done.

Helen



Many thanks Helen.

I'll try and implement it now!










___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !






Yahoo! Groups Sponsor



<http://us.ard.yahoo.com/SIG=1299a3578/M=281955.5600462.6665252.3001176/D=gr
oups/S=1705007183:HM/EXP=1101046914/A=2343726/R=0/SIG=12i6m5t5u/*http:/clk.a
tdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1100960514743573>
<http://us.ard.yahoo.com/SIG=1299a3578/M=281955.5600462.6665252.3001176/D=gr
oups/S=1705007183:HM/EXP=1101046914/A=2343726/R=1/SIG=12i6m5t5u/*http:/clk.a
tdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1100960514743573>

Get unlimited calls to
<http://us.ard.yahoo.com/SIG=1299a3578/M=281955.5600462.6665252.3001176/D=gr
oups/S=1705007183:HM/EXP=1101046914/A=2343726/R=1/SIG=12i6m5t5u/*http:/clk.a
tdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1100960514743573>

U.S./Canada
<http://us.ard.yahoo.com/SIG=1299a3578/M=281955.5600462.6665252.3001176/D=gr
oups/S=1705007183:HM/EXP=1101046914/A=2343726/R=1/SIG=12i6m5t5u/*http:/clk.a
tdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1100960514743573>


<http://view.atdmt.com/VON/view/yhxxxvon01900091von/direct/01/&time=11009605
14743573>



<http://us.adserver.yahoo.com/l?M=281955.5600462.6665252.3001176/D=groups/S=
:HM/A=2343726/rand=428653096>



_____

Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/IBObjects/


* To unsubscribe from this group, send an email to:
IBObjects-unsubscribe@yahoogroups.com
<mailto:IBObjects-unsubscribe@yahoogroups.com?subject=Unsubscribe>


* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
<http://docs.yahoo.com/info/terms/> Service.



[Non-text portions of this message have been removed]