Access 2016 DLookUp systax

I have table tbl_Master Contacts Mailable with contact fields including Zip5 (zip codes).

I have table tbl_Counties Zip Codes with Zip Codes and Counties.

I need to use Access 2016 DLoopUP to add the counties from tbl_counties Zip Codes to the matching Zip5 in tbl_Master Contacts Mailable.

I get the following error: The expression entered contains invalid syntax. You may have entered an operand without an operator.”

find_county:DLookUp (“[County]”,”tbl_Counties Zip Codes”,”[Zip Code]='"&[Zip5]""')

What is the proper coding?
Larry FisackerlyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeOwner, Dev-Soln LLCCommented:
Rather than using a dLookup, why not simply create a query that looks something like:

SELECT MC.*, ZC.County
FROM tbl_Master_Contacts as MC
LEFT JOIN tbl_Zip_Codes as ZC on MC.Zip5 = ZC.Zip5

DLOOKUP is generally time consuming and not nearly as efficient as using a query.

but if you insist on using the DLOOKUP:

find_county:DLookUp (“[County]”,”tbl_Counties Zip Codes”,”[Zip Code]='" & [Zip5] & "'")

I assume this is in a query, not as the control source of a control on a form.  You might consider putting this DLOOKUP in the Control Source of a control on a form if you are using it in a form.  That way, you would not have to compute it for every record in the recordset, only those records which you actually land on.
Larry FisackerlyAuthor Commented:
I pasted the DLoopUP code you sent back. I got the same error. What now?
Gustav BrockCIOCommented:
Try using brackets and true double quotes (no pasting):

find_county: DLookUp ("[County]","[tbl_Counties Zip Codes]","[Zip Code] = '" & [Zip5] & ""')


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

Larry FisackerlyAuthor Commented:
That worked. Thanks.
Dale FyeOwner, Dev-Soln LLCCommented:

Don't forget to close out the question.
Gustav BrockCIOCommented:
Question is answered.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.