dlookup with 2 criterias is giving type mismatch error for ms access 2010
This is my code:
UnitPrice = DLookup("CurrentPrice", "tbl_CustomerProductPrice",
"customerID=" & customer _
And "[ProductID]=" & Me.ProductID)
So, I have a table that specifies the price per product per customer. I
would like the code to automatically enter the unit price based on the
customerID and the productID.
Individually, (i.e UnitPrice = DLookup("CurrentPrice",
"tbl_CustomerProductPrice", "customerID=" & customer) the codes work
without error. This proves that the data type matches. However, when
combined, in order to get the appropriate result for the unit price, it
says error data type mismatch.
I don't understand the problem, thanks in advance.
PS: all data types are long integer.
No comments:
Post a Comment