Page 1 of 1

some help with forgein keys in dropdowns

Posted: Sun Jan 19, 2014 8:31 am
by barrydocks
I wonder if some one might be able to give me a little help. I have 2 tables with a forgein key from one to the other:
TableA
- A_id
- A1
- A2
- FK_B_id

TableB
- B_id
- B1

I have a form displaying TableA and I want FK_B_id to be a dropdown when adding a record. In the dropdown tab in the objects page for FK_B_id I have added the following SQL code:

Code: Select all

select B_id from TableB
but the dropdown does not get populated with any data.

What am I doing wrong???

Thanks

Re: some help with forgein keys in dropdowns

Posted: Sun Jan 19, 2014 1:13 pm
by zazzium
Hi,
try

Code: Select all

select B_id,B1 from TableB
First ( B_id) is option value and second (B1) is option text

Re: some help with forgein keys in dropdowns

Posted: Sun Jan 19, 2014 4:36 pm
by barrydocks
Thanks zazzium, works perfectly!

Still on a bit od a steep learning curve with both nuBuilder and mysql :)

Re: some help with forgein keys in dropdowns

Posted: Tue Jan 21, 2014 12:41 am
by massiws
.