Dlookup

janed

Registered User.
Local time
Today, 11:30
Joined
Feb 6, 2002
Messages
60
could anyone explain the dlookup function and what it can be used for pls?
 
yes, i didnt find it very helpful. i'm not sure if its what i need. i want a form to fill out automatically when i enter certain values. i have this done by putting a subform onto a form and attaching it to a query. but now i want the values from the subform and the main form to go to the same table. as they are both based on different tables i'm not sure if this is possible.
 
The DLookup function looks up a value from a specific field in a specific table where the criteria matches what you want eg on a form If you want to populate an address field based on a employee you could for example in the controlsource of the address field enter
=DLookup("[StaffAddress]","[Staff]","[StaffID] =" & Forms!ThisForm!StaffID

In english this reads - Lookup the Staff Address in the Staff Table where the StaffID is equal to the current StaffID on the form.

You can do this easier by adding the field to the underlying form query but you can use this method in several ways.

Explain your data storage a bit more clearly and what you want to automatically fill in.
 

Users who are viewing this thread

Back
Top Bottom