I'm trying to append to a table. The table layout is as follows:
The code I'm using to perform this (or trying to perform :-( ):
Private Sub CreateReportSet(RptId As Long)
Dim myDb As Database
Dim strSQL As String
Dim strClosed As String
If RptId = 0 Then
Set myDb = CurrentDb
strClosed = """Closed"""
strSQL = "INSERT INTO WeeklyRpt (ReportId, ProjectId, PM) " & _
"SELECT " & CStr(RptId) & " , Projects.ProjectId, Projects.PM " & _
"FROM Projects " & _
"WHERE IsNull([Last Report]) " & _
"OR [Last Report] <> " & strClosed & " " & _
"OR ([Last Report] = " & strClosed & " AND [Revised Completion Date] > #12/31/2003#);"
Set myDb = Nothing
Using Debug I can see that the RptId value is set, but I still get the following error message:
Run-time error '3061': Too few parameters. Expected 1
Instead of using the IsNull function, I've also tried "WHERE [Last Report] IS NULL", but that has the same result.
The rebel without a clue - firstname.lastname@example.org