Current Position:Home > How to create a LOV where it is constrained by another field

How to create a LOV where it is constrained by another field

Update:10-11Source: network consolidation
I'm trying to figure out how to get a LOV to be limited by the value in a column
A complete hypothetical example (the actual app is quite different):
I have 2 tables
clientInfo, with fields fname, lname, age, city, zipcode
In another table named cityZip I have zip & city
So I create a report on a table form
select fname, lname, age, city, zipcode from clientInfo
This generates a nice table form, one entry for each client.... but I want the user to go down the selectList which represents the city column and select the city for each record in the table.
So I created a Select List (query based LOV),
I tried
select DISTINCT (code|| ' ' || city) d, zip_KEY r
from cityZip where = :zipcode
The problem appears that the use of zipcode in the LOV query does not contain the value of the current record's zipcode so it doesn't work! Does anyone have any idea's how this might be done?

The Best Answer

Good morning,
The problem is that the data in your report is not contained in APEX items within your page. Try looking at the Form & Report combination and put your select list in the form. When you click "Edit" on a line, that data populates the form. You then have the information you need to limit the query for your LOV.
Good luck,
You can reward this reply by marking it as either Helpful or Correct :)