I am getting the above error on a query that use to work and I don't know why it stopped working. Here is the SQL as it is right now.
SELECT tblDSGLOBAL_DUPS.PLANT, tblDSGLOBAL_DUPS.IM_ITEM_NBR, qryUDF_BOM_Item.POSTP
FROM ((tblDSGLOBAL_DUPS LEFT JOIN tblFam_Code_U ON (tblDSGLOBAL_DUPS.PLANT = tblFam_Code_U.Plant) AND (tblDSGLOBAL_DUPS.IM_ITEM_NBR = tblFam_Code_U.AEXITM_ITEM_NBR)) LEFT JOIN qryE004_Err ON (tblDSGLOBAL_DUPS.PLANT = qryE004_Err.Planta) AND (tblDSGLOBAL_DUPS.IM_ITEM_NBR
= qryE004_Err.[Item number])) LEFT JOIN qryUDF_BOM_Item ON (tblDSGLOBAL_DUPS.IM_ITEM_NBR = qryUDF_BOM_Item.YSOUKEY) AND (tblDSGLOBAL_DUPS.PLANT = qryUDF_BOM_Item.Plant)
WHERE (((tblDSGLOBAL_DUPS.ITEM_STATUS) Like "2") AND ((tblDSGLOBAL_DUPS.ITEM_TYPE) Not Like "3") AND ((tblDSGLOBAL_DUPS.MAKE_BUY_CODE) Like "1") AND ((qryE004_Err.[Error #]) Is Null) AND ((tblFam_Code_U.AEXITM_FAMLY_CODE) Is Null));
If I remove the qryUDF_BOM_Item from the query, everything works.
SELECT tblDSGLOBAL_DUPS.PLANT, tblDSGLOBAL_DUPS.IM_ITEM_NBR
FROM (tblDSGLOBAL_DUPS LEFT JOIN tblFam_Code_U ON (tblDSGLOBAL_DUPS.PLANT = tblFam_Code_U.Plant) AND (tblDSGLOBAL_DUPS.IM_ITEM_NBR = tblFam_Code_U.AEXITM_ITEM_NBR)) LEFT JOIN qryE004_Err ON (tblDSGLOBAL_DUPS.PLANT = qryE004_Err.Planta) AND (tblDSGLOBAL_DUPS.IM_ITEM_NBR
= qryE004_Err.[Item number])
WHERE (((tblDSGLOBAL_DUPS.ITEM_STATUS) Like "2") AND ((tblDSGLOBAL_DUPS.ITEM_TYPE) Not Like "3") AND ((tblDSGLOBAL_DUPS.MAKE_BUY_CODE) Like "1") AND ((qryE004_Err.[Error #]) Is Null) AND ((tblFam_Code_U.AEXITM_FAMLY_CODE) Is Null));
If I leave the qryUDF_BOM_Item in and remove the Criteria filters from the tblDSGLOBAL_DUPS, again everything works.
SELECT tblDSGLOBAL_DUPS.PLANT, tblDSGLOBAL_DUPS.IM_ITEM_NBR, qryUDF_BOM_Item.POSTP
FROM ((tblDSGLOBAL_DUPS LEFT JOIN tblFam_Code_U ON (tblDSGLOBAL_DUPS.IM_ITEM_NBR = tblFam_Code_U.AEXITM_ITEM_NBR) AND (tblDSGLOBAL_DUPS.PLANT = tblFam_Code_U.Plant)) LEFT JOIN qryE004_Err ON (tblDSGLOBAL_DUPS.IM_ITEM_NBR = qryE004_Err.[Item number]) AND (tblDSGLOBAL_DUPS.PLANT
= qryE004_Err.Planta)) LEFT JOIN qryUDF_BOM_Item ON (tblDSGLOBAL_DUPS.IM_ITEM_NBR = qryUDF_BOM_Item.YSOUKEY) AND (tblDSGLOBAL_DUPS.PLANT = qryUDF_BOM_Item.Plant)
WHERE (((qryE004_Err.[Error #]) Is Null) AND ((tblFam_Code_U.AEXITM_FAMLY_CODE) Is Null) AND ((qryUDF_BOM_Item.POSTP) Is Null));
But doing either of those, doesn't give me the results I need and as mentioned at the beginning, this query was working last week. All I did today was open the database and try to run the query. Nothing was changed.