View Full Version : Dlookup help


no cigar
03-26-2010, 07:47 AM
I need to assign values in one table based on a master list in another.
See below
http://i42.tinypic.com/675h1z.jpg

I need to give table2 the correct manuf names based on the common ID numbers. I tried Dlookup but can't figure out where the code goes. Thanks for helping such a novice lol...

lcook1974
03-26-2010, 08:48 AM
Have you tried the default value in the table property?

Look up Dlookup in the help menu for correct syntax.

LWC

SOS
03-26-2010, 09:07 AM
1. DLookup doesn't work at table level.

2. I can't see your photo since you didn't upload it here and chose a pic site which is blocked by my work. Try uploading here next time so more people can see it.

3. You should not be storing dependent information in a table. One field should not be dependent on another and if you are trying to store both an ID and description which already exists in another table then that is wrong and you should only be storing the ID from the one table into the second table and then a query can pull together the description for the ID when you need to use it.

no cigar
03-26-2010, 10:42 AM
Sorry I should have clarified... I'm trying to put this info into a report. If I could create an unbound text box and add the dlookup into the code for that box, it would meet my needs.

pbaldy
03-26-2010, 10:51 AM
The normal solution would be to use a query that joins the two tables as the source of the report. It would be a lot more efficient than the DLookup. If you really want the DLookup, in a control source it would look like:

=DLookup(...)

http://www.mvps.org/access/general/gen0018.htm