@DB Lookup new question
Posted on 2008-06-19
Am creating a customer form for my new DB so that when user select the company name, all the information of Customer name, Tel, email will appear automatically in the form.
But one company can have a few employees so I manage to list out the employees under the company name so that user can choose the customer name. But how can I use DB lookup for the telephone field so that whoever names are choosen, the correct tel number will list out?
My view looks like this
Company Name Customer name Tel Email
xyz pte ltd steven 1234567 email@example.com
Alvin 7654321 firstname.lastname@example.org
David 0949321 email@example.com
abc pte ltd Lily 1231231 firstname.lastname@example.org
francis 5677766 email@example.com
when user choose xyz in my form, it will list out 3 names in the dialog field "steven, alvin, David" for user to choose the correct customer name. But what is the correct code to use if user choose alvin and telephone number "7654321" will appear?
Currently I try use below code to search for the correct tel number :
tmp:=@DbLookup("";"Singapore":"DHS Machine Reservation.nsf";"Customer Contact";CustName;3);
But it doesn't work. It appears blank. May I know what is the correct code that I should use?
Thanks a million to all who can help me. :-)