B
Bob Quintal
=DLookup("[ContactEmail]","[Contacts]" "[ContactName] =I have a Form 'frmTest DLookup' that is used to input data
into a table 'tblTest DLookup'. The table was build with a
lookup to the 'Contacts' table to provide a drop-down of
available contacts when completing the form.
The 'tblContacts' contains 'ContactName' and 'ContactEmail'
fields The 'frmTest DLookup' contains 'Contact' and 'Email'
fields used for entry into the 'tblTest DLookup'
I am trying to use DLookup to populate the 'ContactEmail'
field in the form and thus the underlying table based on the
value entered in the 'Contact' field of the same form.
This is the solution straight from the MS Help (modified w/ my
names of course):
DLookup("[ContactEmail]","[Contacts]","[ContactName] =
Forms![Contact]")
I've placed it in the Control Source of the 'ContactEmail'
field of the form. It returns #Name? in the Contact Email
field of the form. If I add an '+' at the front, the
'ContactEmail' field stays blank and can not be clicked on.
Any help on this? Another method? I've read about the SELECT
Query but am not sure where to place that.
Thanks
You need an = in front of it
You will also need to put the name of the form in the criteria
Forms![What's the name of the form?]![Contact]")