Having fixed my previous issues I'm now trying something else, I want to use 2 list boxes on a form to input to a query but can't for the life of me get the SQL statement to work properly
Both my functions to build the lists of selected items from each list box work fine and report correctly it's only the SQL statement itself that keeps throwing up syntax errors
Any advice or help greatly appreciated
Both my functions to build the lists of selected items from each list box work fine and report correctly it's only the SQL statement itself that keeps throwing up syntax errors
Any advice or help greatly appreciated
Code:
strSQL = "SELECT tblMEList.[Equipment Tag], tblCat.[GCFS Cat], tblPlatformList.Vessel, tblClass.Class, tblShipFitData.[Quantity fitted]" & _
"FROM ((tblCat INNER JOIN tblMEList ON tblCat.[GCFS Cat] = tblMEList.[GCSF Cat]) INNER JOIN tblShipFitData ON tblMEList.[Equipment Tag] = tblShipFitData.Equipment) INNER JOIN (tblClass INNER JOIN tblPlatformList ON tblClass.Class = tblPlatformList.Class) ON tblShipFitData.Vessel = tblPlatformList.Vessel "
strSQL = strSQL & "WHERE tblClass.Class IN (" & strClassCriteria & ") AND WHERE tblCat.[GCFS Cat] IN (" & strCatCriteria & ");"