Hello all,
I am at a lost with troubleshooting my SQL string. I am receiving a “Syntax error in parameter clause”.
I do not think I have exceeded the number of characters for a SQL string.
Also ensured the semicolon after the Parameters line and inserted with “& _” on each end within my VBA code.
All parameters are text. When I tried in Access' Query tool without parameters, the query runs.
Do you see where I went wrong?
Thanks.
I am at a lost with troubleshooting my SQL string. I am receiving a “Syntax error in parameter clause”.
I do not think I have exceeded the number of characters for a SQL string.
Also ensured the semicolon after the Parameters line and inserted with “& _” on each end within my VBA code.
All parameters are text. When I tried in Access' Query tool without parameters, the query runs.
Do you see where I went wrong?
Thanks.
Code:
strSQL = "PARAMETERS [Forms]![frmB]![cboB] Text ( 255 ), [Forms]![frmB]![lstT] Text ( 255 ), [Forms]![frmB]![lstSolution] Text ( 255 ), [Forms]![frmB]![lstReporting] Text ( 255 ), [Forms]![frmB]![lstReporting] Text ( 255 ), [Forms]![frmB]![lstProjType] Text ( 255 ), [Forms]![frmB]![lstS] Text ( 255 ), [Forms]![frmB]![lstArea] Text ( 255 ); " & _ "SELECT tbMastfinal.Funding, tbGP.GrProgram, tbT.TCLIDname, tbSA.SAName, tbStates.StateName, tbRP.RPname, tbProjectTypes.ProjectTypeName, tbRegions.RegionName, tbArea.AName " & _ "FROM tbT INNER JOIN (tbProjectTypes INNER JOIN (tbGP INNER JOIN (tbRegions INNER JOIN (tbArea INNER JOIN (tbSA INNER JOIN (tbRP INNER JOIN (tbStates INNER JOIN tbMastfinal ON tbStates.StateID = tbMastfinal.StateID) ON tbRP.RP_ID = tbMastfinal.RP_ID) ON tbSA.SA_ID = tbMastfinal.SA_ID) ON tbArea.AreaID = tbMastfinal.AreaID) ON tbRegions.RegionID = tbMastfinal.RegionID) ON tbGP.GrPrgID = tbMastfinal.GrPrgID) ON tbProjectTypes.ProjectTypeID = tbMastfinal.ProjectTypeID) ON tbT.TCLID = tbMastfinal.TCLID " & _ "WHERE (((tbGP.GrProgram)=[Forms]![frmB]![cboB]) AND ((tbT.TCLIDname)=[Forms]![frmB]![lstT]) AND ((tbSA.SAName)=[Forms]![frmB]![lstSolution]) AND ((tbStates.StateName)=[Forms]![frmB]![lstReporting]) AND ((tbRP.RPname)=[Forms]![frmB]![lstReporting]) AND ((tbProjectTypes.ProjectTypeName)=[Forms]![frmB]![lstProjType]) AND ((tbRegions.RegionName)=[Forms]![frmB]![lstS]) AND ((tbArea.AName)=[Forms]![frmB]![lstArea]));"
Comment