View Full Version : Using DLookup function in forms


TGHockett
10-31-2000, 07:09 PM
I am not sure if using DLookup is the right way to go, but basically spent most of the afternoon trying to figure out to have the foreign table (MasterIDsNames) feed the Dealername, when the user adds a new record and enters the DealerID# on the form for the ProgramTracking table.

Everything works fine of course when the user works with existing records (with the ID# and Dealername already entered of course), but when I try to add a new record using the DealerID#, I am stuck.

I initially tried something like : Iif([Dealername]=IsNull, DLookup("[Dealername]","MasterIDNames"),[Dealername]]

This didn't work for numerous reasons, and then I tried various list/combo boxes for the user to select the ID# and Name at the same time but no luck.

Once again will appreciate anyone's help on this ....

TGH

TGHockett
11-02-2000, 08:09 PM
I'm glad no one wasted their time on what turned out to be a simple answer to my problem... as usual http://www.access-programmers.co.uk/ubb/smile.gif

The day after I posted the above note I remembered from a previous app I need to use two different forms -- one for adding new dealers (with the DLookup working fine now), and the other form for editing existing records.

K*I*S*S in action!