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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

@DbLookup Problem. Index not built error!

Status
Not open for further replies.

tracia

Programmer
Jan 27, 2003
4
MY
Hi, I'm designing a Leave Application. I have 2 Forms. Form 1 is used to enter employee particulars. Form 2 is the Leave Application Form. When the staff enters their name in Form 2, I want their particulars like id, designation that was entred in Form 1 to be displayed. I used this formula,

@DbLookup("";"":"PAL.NSF";"LA";@Do(PersonApply;"");"ID")

Everytime I preview I get Field:'ID':Entry Not Found in index or view's index not built.

My first column in my view is sorted. Since I cannot specify a particular staff's name as the key and want the name entered in the PersonApply field to be fetched, have I coded it right? I've been stuck on this for weeks. Pls help. Thanx.
 
There are three points to check if your @db formulas are a problem :

1) make sure your database design admits a default view and a default form. Every db should have one. If you do not know, simply choose the most-used view/form, open the properties and click the "default form for this database" or "default when db is opened" option.
2) make sure the first column of the view you use is sorted (this, you state, is done).
3) Avoid including formulas in lookups, use only variables who'se value has been defined prior to the @db call.

Concerning the third point, I have by experience determined that it is a bad idea to evaluate anything in a lookup formula. Extract your @do formula (which, in my opinion, is the problem) and assign the key value you need to work with to a temporary variable BEFORE the lookup. Placing then temp var as key will ensure that the lookup should be performed correctly.
If it still doesn't work, you will have the possibility of checking that the key is valid with the debugger, something you cannot do if you include the evaluation in the @db formula.
 
Thank you so much. I guess it was the @Do. I did step1 and it works perfectly now.
 
Thank you very much. It was after all the @Do that was the problem.Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top