How do lookup when the values aren't a perfect match?

I have this Dlookup syntax and am trying to link the value in a table to the value on a form.

DLookup("[PLU #]", "tblImportedExcelData", "[Criteria] = " & Forms![Customer Details 2]!CustomerName)

But the problem is, for example, the value on the form may be "00000000000051"  (without the quote marks obviously).  And the value in the table  is "51".

In other words the two relate using the right-most characters.  They are both number fields.

What would the corrected DLookup syntax be?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

SteveL13Author Commented:
What I have found is that the number field in the formis always 14 "characters".  So I've tried formatting the number in the table by using this:  (which isn't working)

DLookup("[Week1]", "tblImportedExcelData", Format("([UPC],"00000000000000")) = " & Forms![Customer Details 2]!CustomerName)
Rey Obrero (Capricorn1)Commented:

DLookup("[Week1]", "tblImportedExcelData", Format("([UPC],"00000000000000") = '" & Forms![Customer Details 2]!CustomerName  & "')"


DLookup("[Week1]", "tblImportedExcelData", "[UPC] = " & Val(Forms![Customer Details 2]!CustomerName))

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
SteveL13Author Commented:

DLookup("[Week1]", "tblImportedExcelData", Format("([UPC],"00000000000000") = '" & Forms![Customer Details 2]!CustomerName  & "')"
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.