Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dblookup via web - multiple times

Status
Not open for further replies.

DoctorGonzo

Programmer
Jan 23, 2004
48
GB
Hi All,

I have a view with three columns : flight_date, base and flight_number.

I have a form with three drop-down fields which correspond to the three fields in the view.

The first drop down (flight-date) has a list of dates.

The second drop down (base) performs a lookup to the view and returns a list of BASES along with a default base.

The formula below works perfectly for this :

list:=@DbLookup("":"NoCache";"":"Extranet\\IFR.nsf";"vRouteListLookup2"; flight_date ; "base");
defaultList:=@DbLookup("":"NoCache";"":"Extranet\\IFR.nsf";"vRouteListLookup2"; "Default" ;"base");
addList:=@If(@IsError(list) | list = "";defaultList;list:defaultList) ;
"[Select]":addList

What I want is for my third field to look up and return a list of flight_numbers for the base selected - similar to the above, which is returning a list of bases depending on the flight_date selected.

So, I select 24-Mar-2005 in my first field, and it looks up and returns "MAN" and "LHR" in my base list. if MAN has flight_numbers "1" and "2" and LHR has flight_numbers "3" and "4", then if I select MAN, I want the third field on the form to list "1" and "2".

I have tried copying my view to another, but with just base and fligh_number and have my flight_number field look up to this one with BASE as the key, but to no avail. (log says entry not foud in index".

I've also tried messing around with categories in my view.

Can anyone advise? I'm basically "drilling down" with each selection in a dropdown.

Please help!

Confused Gonzo
 
Rule #1 : to search in a view the first column has to be sorted
Rule #2 : to ensure proper usage of @DbColumn or @DbLookup make sure the db design has a default view and a default form.
Rule #3 : Notes being not a RDBMS, you cannot "drill down" in the same view, you must create a view for each type of search you wish to accomplish via code.

You have apparently respected rule 3, and I suppose that the first view respects rule 1, so either your db does not comply with rule 2, or your 2nd view does not comply with rule 1 (or you have an error in your formula or in your 2nd view).

So let's see, the last search you want to find 1 and 2 for value MAN. That means that the view must have its first column sorted on the field that contains MAN, and its second column must contain the field that holds the 1 and 2 values.

So, make sure your second view is as described, and check for rule compliance, and you should be sorted :).

Pascal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top