View Full Version : Dlookups


Lee h
09-16-2001, 03:45 AM
I am new to access and my previous experience was with excel. Basically I want a field/s to populate automatically to what is put into another field. (a vlookup in excel).
I tried a few things I found in the help file etc but none have worked.
I.e Populate the location field in the new Beer form from the brewerys table when the brewery name on the form is equal to the brewery name on the table.
=DLookUp("LOCATION","BREWERYS","BREWERY NAME =[BREWERY NAME] ")
Please help. I entered this in the control source on the field i need to be populated is this correct?

Alexandre
09-16-2001, 07:01 AM
All that is between quotes is interpreted as a fixed statement by ACCESS. If you want ACCESS to estimate and use the value of [BREWERY NAME] you have to get it out of the quotes.
The second important point is that all string values must be surrounded by ':


=DLookUp("LOCATION","BREWERYS","BREWERY NAME = '" & [BREWERY NAME] & "'")


Alex

[This message has been edited by Alexandre (edited 09-16-2001).]

Rich
09-16-2001, 09:25 AM
If you already have the brewery location stored elsewhere, why do you need to store it again in another table?