M
mattc66 via AccessMonster.com
Hi All,
I am doing a DLookup. I want to lookup the cost based on 3 parameters in the
table. Calcode, Product and WoodType and then return the result. I think the
problem is my syntax. Can anyone help me with the below DLookup string?
Thanks
varWDT = Me.cboCC_Mtl.Column(4)
varRMT = "CC"
'Lookup costs
varLAB = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=100 & [Product]
=varRMT &_ [WoodType]=varWDT")
varBNC = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=101 & [Product]
=varRMT &_ [WoodType]=varWDT")
varFLR = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=102 & [Product]
=varRMT &_ [WoodType]=varWDT")
varLUX = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=103 & [Product]
=varRMT &_ [WoodType]=varWDT")
varSKT = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=104 & [Product]
=varRMT &_ [WoodType]=varWDT")
varCDR = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=1 & [Product]
=varRMT &_ [WoodType]=varWDT")
varFIX = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=105 &
[Product]=varRMT &_ [WoodType]=varWDT")
I am doing a DLookup. I want to lookup the cost based on 3 parameters in the
table. Calcode, Product and WoodType and then return the result. I think the
problem is my syntax. Can anyone help me with the below DLookup string?
Thanks
varWDT = Me.cboCC_Mtl.Column(4)
varRMT = "CC"
'Lookup costs
varLAB = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=100 & [Product]
=varRMT &_ [WoodType]=varWDT")
varBNC = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=101 & [Product]
=varRMT &_ [WoodType]=varWDT")
varFLR = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=102 & [Product]
=varRMT &_ [WoodType]=varWDT")
varLUX = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=103 & [Product]
=varRMT &_ [WoodType]=varWDT")
varSKT = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=104 & [Product]
=varRMT &_ [WoodType]=varWDT")
varCDR = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=1 & [Product]
=varRMT &_ [WoodType]=varWDT")
varFIX = DLookup("[CostPer]", "tblQuoteParamsNew", "[CalcCode]=105 &
[Product]=varRMT &_ [WoodType]=varWDT")