I am gettign Error 3061 Too Few parameters, Expected=1
Dim RSH_W As DAO.Recordset
strSQL_WH = "SELECT DISTINCT RPTBASE_BROKER_PRICING.CONTAINER_SIZE FROM RPTBASE_BROKER_PRICING" _
& " WHERE ((RPTBASE_BROKER_PRICING.Product_Type) = 'W')" _
& " ORDER BY RPTBASE_BROKER_PRICING.CONTAINER_SIZE;"
Set RSH_W = DB.OpenRecordset(strSQL_WH)
The base Query RPTBASE_BROKER_PRICING is tied to a form that is open when this code is running. There are no parameters defined for the base query.
Can someone shed some light on this error please? I have not been able to find anything that reveals and actual cause.
I cheat a bit with the followign code to make sure my SQL is correct:
'SQL Testing Section:
'DoCmd.OpenForm "SQLTester"
'With Forms!SQLTester
' .txtSQL = strSQL_WH
'End With
The SQL command works without issue when pasted into a blank query.
Dim RSH_W As DAO.Recordset
strSQL_WH = "SELECT DISTINCT RPTBASE_BROKER_PRICING.CONTAINER_SIZE FROM RPTBASE_BROKER_PRICING" _
& " WHERE ((RPTBASE_BROKER_PRICING.Product_Type) = 'W')" _
& " ORDER BY RPTBASE_BROKER_PRICING.CONTAINER_SIZE;"
Set RSH_W = DB.OpenRecordset(strSQL_WH)
The base Query RPTBASE_BROKER_PRICING is tied to a form that is open when this code is running. There are no parameters defined for the base query.
Can someone shed some light on this error please? I have not been able to find anything that reveals and actual cause.
I cheat a bit with the followign code to make sure my SQL is correct:
'SQL Testing Section:
'DoCmd.OpenForm "SQLTester"
'With Forms!SQLTester
' .txtSQL = strSQL_WH
'End With
The SQL command works without issue when pasted into a blank query.