This topic is locked

Nested Lookups

2/28/2006 8:19:03 AM
PHPRunner General questions
T
thesofa author

The idea of nesting lookup fields is brilliant, but of course, I want to change it slightly, can I work it somehow so there are 3 levels of lookup involved?

Find pupil in tutorgroup in yeargroup?

so i use a lookup table to find the yeargroup, that then sets that yeargroup table as the target for a lookup for the tutor group, this being the source for the pupil's name?

Sergey Kornilov admin 2/28/2006

Sure, this will work.

Just make tutorgroup lookup to be dependent on yeargroup and link poupil to tutorgroup.

T
thesofa author 2/28/2006

Sure, this will work.

Just make tutorgroup lookup to be dependent on yeargroup and link poupil to tutorgroup.



can I use one lookup to select the yeargroup, then the next one looks up the pupils from one of 5 different tables, one for each yeargroup, more like a `case` select type of construct?

Sergey Kornilov admin 3/1/2006

Hi,
you need to create View in your database, which include 5 tables. See my example of SQL code below:

create view v_pupils as

select 1 as yeargroup, name, ... from pupils1

union all

select 2 as yeargroup, name, ... from pupils2

union all

select 3 as yeargroup, name, ... from pupils3

...



Then select this View for lookup field in Table dropdown box on the Edit format dialog on the Formatting Tab.