Dlookup in a query or vba
Posted on 2011-05-06
I think this is a pretty remedial question but it is doing my head in... I have two tables I have a contacts table with a unique identifier called Contact_Id. I use that in other tables. Now, I am trying to do a dlookup to send a subject line for Outlook and the dlookup is returning the first value in the contacts table for all records.
dim Employ as string
What I have is Employ = DLookup("[firstname]", "tbl_contacts", "[contact_id] = contact_id")
The query it is referencing is another table that has the contact_ID in it. What I want is the unique first name of each contact is returned. What I am getting is the first name in the table being returned for all records. The Contact_ID is a number.