J
James
Hi,
I have the following code, I have checked spelling for everything but it
still comes up with "Run-time error: 3061: too few parameters, Expected 1"
Can anyone tell me why!?
CurrentDb.Execute "INSERT INTO exams ( appreceived, datesent, datein,
examcode, examdate, resultsreceived, " & _
"resultssent, confirmation, invoicesent, feepaid, centre, collegeid,
grade, oldstunum ) " & _
"SELECT '" & AppDate & "' AS Expr2, '" & AppDate & "' AS Expr3, '" & AppDate
& "' AS Expr4, " & _
"IIf(" & StrInt & StrExam & "<>'','M2','M3') AS Expr5, " & _
"'" & ExamDate & "' AS Expr1, '" & ResultsDate & "' AS Expr8, '" &
ResultsDate & "' AS Expr9, " & _
"'" & AppDate & "' AS Expr10, '" & AppDate & "' AS Expr11, " & _
"'" & ResultsDate & "' AS Expr12, 1 AS Expr6, 1 AS Expr7,
IIf(([grade]='A'),'Distinction',IIf(([grade]='B'),'Merit'," & _
"IIf(([grade]='C'),'Pass',IIf(([grade]='F'),'Fail',IIf(([grade]='N/C'),'N/C',IIf(([grade]='DNA')," & _
"'DNA',IIf(([grade]='F*'),'Partial',IIf(([grade]='TR'),'DNA',''))))))))
AS Expr13, Westminster.autonum " & _
"FROM Westminster " & _
"WHERE (((Westminster.[Int Oct 97]) Is Not Null) AND (((Westminster.Expiry)
Like '*/05') OR ((Westminster.Expiry) " & _
"Like '*/06') OR ((Westminster.Expiry) Like '*/07') OR
((Westminster.Expiry) Like '*/08') OR ((Westminster.Expiry) " & _
"Like '*/04')) AND (((Westminster.mg)<>'c') And
((Westminster.mg)<>'can') AND ((Westminster.mg)<>'canc'))) OR " & _
"((((Westminster.Expiry) Like '*/05') OR ((Westminster.Expiry) Like
'*/06') OR ((Westminster.Expiry) Like '*/07') OR " & _
"((Westminster.Expiry) Like '*/08') OR ((Westminster.Expiry) Like
'*/04')) AND (((Westminster.mg)<>'c') AND " & _
"((Westminster.mg)<>'can') AND ((Westminster.mg)<>'canc')) AND
(((Westminster.[Adv Oct 97])) Is Not Null));"
CurrentDb.Close
Many thanks. James.
I have the following code, I have checked spelling for everything but it
still comes up with "Run-time error: 3061: too few parameters, Expected 1"
Can anyone tell me why!?
CurrentDb.Execute "INSERT INTO exams ( appreceived, datesent, datein,
examcode, examdate, resultsreceived, " & _
"resultssent, confirmation, invoicesent, feepaid, centre, collegeid,
grade, oldstunum ) " & _
"SELECT '" & AppDate & "' AS Expr2, '" & AppDate & "' AS Expr3, '" & AppDate
& "' AS Expr4, " & _
"IIf(" & StrInt & StrExam & "<>'','M2','M3') AS Expr5, " & _
"'" & ExamDate & "' AS Expr1, '" & ResultsDate & "' AS Expr8, '" &
ResultsDate & "' AS Expr9, " & _
"'" & AppDate & "' AS Expr10, '" & AppDate & "' AS Expr11, " & _
"'" & ResultsDate & "' AS Expr12, 1 AS Expr6, 1 AS Expr7,
IIf(([grade]='A'),'Distinction',IIf(([grade]='B'),'Merit'," & _
"IIf(([grade]='C'),'Pass',IIf(([grade]='F'),'Fail',IIf(([grade]='N/C'),'N/C',IIf(([grade]='DNA')," & _
"'DNA',IIf(([grade]='F*'),'Partial',IIf(([grade]='TR'),'DNA',''))))))))
AS Expr13, Westminster.autonum " & _
"FROM Westminster " & _
"WHERE (((Westminster.[Int Oct 97]) Is Not Null) AND (((Westminster.Expiry)
Like '*/05') OR ((Westminster.Expiry) " & _
"Like '*/06') OR ((Westminster.Expiry) Like '*/07') OR
((Westminster.Expiry) Like '*/08') OR ((Westminster.Expiry) " & _
"Like '*/04')) AND (((Westminster.mg)<>'c') And
((Westminster.mg)<>'can') AND ((Westminster.mg)<>'canc'))) OR " & _
"((((Westminster.Expiry) Like '*/05') OR ((Westminster.Expiry) Like
'*/06') OR ((Westminster.Expiry) Like '*/07') OR " & _
"((Westminster.Expiry) Like '*/08') OR ((Westminster.Expiry) Like
'*/04')) AND (((Westminster.mg)<>'c') AND " & _
"((Westminster.mg)<>'can') AND ((Westminster.mg)<>'canc')) AND
(((Westminster.[Adv Oct 97])) Is Not Null));"
CurrentDb.Close
Many thanks. James.