Forgive me but I thought this would be something simple. I am trying to execute a piece of SQL inside a DLookup(). Is that possible? I keep getting a run-time error when I try to execute.
Code:
mySQL = "SELECT * FROM tblSKUMin_Max WHERE [SKU] = '" & vSKU & "';"
vMin = DLookup("SKUMin", mySQL, "[SKUClass] = '" & vStoreClass & "'")
vMax = DLookup("SKUMax", mySQL, "[SKUClass] = '" & vStoreClass & "'")
Form_SfrmEmail.txtMedMin.Value = vMin
Form_SfrmEmail.txtMedMax.Value = vMax
Error States:
"The Microsoft Acces database engine cannot find the input table or query 'SELECT * FROM tblSKUMin_Max WHERE [SKU] = '(SKU NUMBER)';'. Make sure it exists and that its name is spelled correctly."