Page 1 of 1

Using SQL Lookup Values in Browse Form Columns

Posted: Fri Aug 01, 2014 2:38 pm
by jkdev
I would like to display looked up values from another table in Browse Form Column.

I followed the Tutorial but could not figure out how to have a SQL like follows as the DISPLAY criteria:
SELECT prt_type FROM producttype WHERE prt_typeid = pro_type

If I enter a SQL statemement like this, from the error message it appears that teh code tries to embed my SQL statment inside another SELECT statement which convers the whole form and then fails.

In your tutorial, it is shown as just IF THEN statment and embed the values in the statement. I want the values to be looked up from another table.

jk

Re: Using SQL Lookup Values in Browse Form Columns

Posted: Mon Aug 04, 2014 12:57 am
by massiws
jkdev,
you have to get values from the producttype table using JOIN in SQL field:

Code: Select all

SELECT * FROM product INNER JOIN producttype ON prt_typeid = pro_type 
So in Browse Display field you can simply insert the producttype field name:

Code: Select all

prt_type
Hope this helps,
Max

Re: Using SQL Lookup Values in Browse Form Columns

Posted: Fri Aug 08, 2014 8:29 am
by jkdev
Thanks! Got the concept now.

Re: Using SQL Lookup Values in Browse Form Columns

Posted: Sun Aug 10, 2014 6:58 pm
by massiws
.