[Gambas-user] Looking up data from a second table

T Lee Davidson t.lee.davidson at gmail.com
Mon Feb 19 21:39:11 CET 2018


Perhaps you could use a SELECT with JOIN statement in the DataSource.Table property.

'This property can take any SQL "SELECT" request actually. If the string does not begin with "SELECT ", it is taken as a table
name.'


On 02/19/2018 03:17 PM, bkv at mailbox.org wrote:
> Hi
> 
> I have a form with a Datasource and the datasource's Table property is set to a table called /patron./ I have some fields from
> /patron/ in my form and I view and update them.
> 
> Now, patron also has a foreign key to a table called /krutt,/ named /krutt_id./ I need to get one field out of /krutt/ and
> display it on my form (read only).
> 
> I can do this with a db.select using the /krutt_id/ from /patron/ as key to table /krutt/ when I put the field /krutt_id/ from
> /patron/ on my form and make it visible. But I don't want to display the field /krutt_id /on my form.
> 
> Is there any way I can get the value of /krutt_id/ without putting it on the form? I have looked at the Datasource object with
> no result.
> 
> Or is there a complete different solution?
> 
> -Bjørn
> 

-- 
Lee


More information about the User mailing list