Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lookup problem

Status
Not open for further replies.

mbaddar

Programmer
May 10, 2001
120
US
Hi,

This thing is driving me crazy. I have a lookup that's supposed to be checking if a reference number exists for a particular part. The CatalogPage criteria in my lookup does not work. I'm not getting any error messages on this criteria but the lookup is getting data from CatalogPage fields other than the one I specify in my lookup.
Can anyone see anything wrong with this code?

Dim RefCheck As Variant

RefCheck = DLookup("[ReferenceLine]", "BillofMaterials", "[Catalog] = " & """" & Catalog & """" & " AND [CatalogPage] = " & CatalogPage & " AND [ReferenceLine] = " & ReferenceLine)
Thanks a ton for any help,
mbaddar


 
Try this...

Dim RefCheck As Variant

RefCheck = DLookup("[ReferenceLine]", "BillofMaterials", "[Catalog] = '" & """" & Catalog & """" & "' AND [CatalogPage] = '" & CatalogPage & "' AND [ReferenceLine] = '" & ReferenceLine&"'")
 
Hi TTTHio,

I'll try that out and let you know how it works.

Thanks,
mbaddar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top