@DBLookup quesry on Combobox formula

Greetings all

im making a simple project. I have two seperate databases Employee.nsf and Config.nsf.

  • Config.nsf contains only Country and their respective City names

  • Employee.nsf has information about employee

What i wish to do is, if a user enters a country in a field present in form in Employee.nsf, its respective cities are displayed in a combo box on the same form.

im using

@dblookup(“”:“NoCache”; “Server1”:“Config.nsf”; “CityView”; country; “City”)

  • Server1 is the server name

  • Config.nsf has a view CityView containing city and countries

country is a field on my form which is used as key

  • “City” is column name in CityView

can any1 tell me where i am wrong? actually its not working and im pretty sure im stuck at some minor point. plz help me if u understand it.

Subject: @DBLookup quesry on Combobox formula

I expect what you’re doing wrong is you’ve placed the @dblookup in the Choices.

The reason why this is a problem is because the code is “run” when the form is loaded. At that time, you’ve not set the country. Therefore, the city lookup fails.

I normally get around this by using a graphics icon and hotspot to set the city field. This is actually done in the Lotus Notes address book.

Hope that helps.

Subject: @DBLookup quesry on Combobox formula

Refresh the form whenever after you have entered the country name in ‘country’ field. May be you can use onChange event or onExit event depending on your situation.

Another check point is, check the ‘CityView’ is sorted by ‘country’ column. Sometimes people forgot to sort and you won’t get the results.

Hope this will help.