NeilBelgium
IS-IT--Management
dear all,
I have a recordset drawn from four rows of my db. I've recently added a fifth, and wish to amend the rs accordingly.
I simply copied and pasted the original and changed the variable name.
It all looks OK to me, but in testing the recordset I get the error:
[odbc access driver]. Too few parameters. expected 1.
i copy the two statements (original & amended) below. i really can't see what the problem is!
original:
rsReport1.Source = "SELECT *, (SELECT (SUM(BOSS)/4) FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"
+ "' AND Q_NUMBER IN (1,2,3,4)) AS BOSSES, (SELECT (SUM(COLLEGUE)/4) FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"
+ "' AND Q_NUMBER IN (1,2,3,4)) AS COLLEGUES, (SELECT (SUM(SUBORDINATE)/4) FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"
+ "' AND Q_NUMBER IN (1,2,3,4)) AS SUBORDINATES, (SELECT (SUM(CUSTOMER)/4) FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"
+ "' AND Q_NUMBER IN (1,2,3,4)) AS CUSTOMERS FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"
+ "' AND Q_NUMBER IN (1,2,3,4)"
amended:
rsReport1.Source = "SELECT *, (SELECT (SUM(BOSS)/4) FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"
+ "' AND Q_NUMBER IN (1,2,3,4)) AS BOSSES, (SELECT (SUM(SELF)/4) FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"
+ "' AND Q_NUMBER IN (1,2,3,4)) AS SELFS, (SELECT (SUM(COLLEGUE)/4) FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"
+ "' AND Q_NUMBER IN (1,2,3,4)) AS COLLEGUES, (SELECT (SUM(SUBORDINATE)/4) FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"
+ "' AND Q_NUMBER IN (1,2,3,4)) AS SUBORDINATES, (SELECT (SUM(CUSTOMER)/4) FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"
+ "' AND Q_NUMBER IN (1,2,3,4)) AS CUSTOMERS FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"
+ "' AND Q_NUMBER IN (1,2,3,4)"
thanks!
I have a recordset drawn from four rows of my db. I've recently added a fifth, and wish to amend the rs accordingly.
I simply copied and pasted the original and changed the variable name.
It all looks OK to me, but in testing the recordset I get the error:
[odbc access driver]. Too few parameters. expected 1.
i copy the two statements (original & amended) below. i really can't see what the problem is!
original:
rsReport1.Source = "SELECT *, (SELECT (SUM(BOSS)/4) FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"





amended:
rsReport1.Source = "SELECT *, (SELECT (SUM(BOSS)/4) FROM REPORTS WHERE MGR_DIR = '" + Replace(rsReport1__MMColParam, "'", "''"






thanks!