If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#21
|
|||
|
|||
Lookup in the Form
John,
The answer is : =DLookUp("[Address]","Hotel","[Supplier] = """ & [Supplier] & """") however, one question, what if the "return value" is null. i can edit the field . i.e input whatever data i want .. Is there any solution ?! Eric "John W. Vinson" ... On Tue, 3 Feb 2009 10:04:31 +0800, "Eric" wrote: John You are wonderful I've 2 tables - a) voucher b) hotel i use voucher as a form where have fields - "supplier" and "address" i want user to input the name of supplier in "supplier" and the "address" field will show the address of the supplier Both data are saved in table - hotel In other word, my sources of data is [hotel] the field that i need to look up is " address" and it depends on the input of "supplier" = Dlookup("[address]","hotel","[hotel]="""&[hotel] & """) But this is not working I'm sorry, Eric, but this isn't making any sense at all. You refer to fields named Supplier and Address. Your query refers to a field named Hotel (and also to a table named Hotel). You say you have a table named voucher that you "use as a form". A table is one kind of object; a form is a different kind of object. You CAN'T "use a table as a form". GUESSING that you have a field named Supplier in the table named Hotel then =DLookUp("[Address]", "[Hotel]", "[Supplier] = """ & [something] & """") might work. I don't know what you should put in for [something] because I cannot see your form and do not know the context - put the name of whatever control on the form would identify the supplier. If supplier is a Lookup Field this will need more work - is it? -- John W. Vinson [MVP] |
#22
|
|||
|
|||
Lookup in the Form
On Tue, 3 Feb 2009 22:30:00 +0800, "Eric" wrote:
John, The answer is : =DLookUp("[Address]","Hotel","[Supplier] = """ & [Supplier] & """") however, one question, what if the "return value" is null. i can edit the field . i.e input whatever data i want .. Is there any solution ?! Well... it certainly would have shortened the discussion if you'ld mentioned this earlier. Of course you cannot edit the result of a calculated expression. What is the context? Where are you using this? Are you trying to *STORE* the address somewhere (because the DLookUp certainly will not do so)? -- John W. Vinson [MVP] |
#23
|
|||
|
|||
Lookup in the Form
If possible, the "context" can be saved at the table - [Master] which the
rest of the data are all stored here Eric. "John W. Vinson" ... On Tue, 3 Feb 2009 22:30:00 +0800, "Eric" wrote: John, The answer is : =DLookUp("[Address]","Hotel","[Supplier] = """ & [Supplier] & """") however, one question, what if the "return value" is null. i can edit the field . i.e input whatever data i want .. Is there any solution ?! Well... it certainly would have shortened the discussion if you'ld mentioned this earlier. Of course you cannot edit the result of a calculated expression. What is the context? Where are you using this? Are you trying to *STORE* the address somewhere (because the DLookUp certainly will not do so)? -- John W. Vinson [MVP] |
#24
|
|||
|
|||
Lookup in the Form
On Wed, 4 Feb 2009 22:19:50 +0800, "Eric" wrote:
If possible, the "context" can be saved at the table - [Master] which the rest of the data are all stored here I've read this three or four times, Eric, and I still can't make any sense of it. Please explain again what data you have; where it's stored; and what you want as a result. -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|