Hi There,
I'm getting a "Too few parameters. Expected 1." message with this code, can anyone see why.
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Dim strSQL As String
strSQL = "INSERT INTO tblTeams ( TGameNo, TTeam, TFor, TAgainst )" & _
"SELECT tblGameScore.GameNo, tblfixtures.FTeam1, tblGameScore.For, tblGameScore.Against " & _
"FROM tblGameScore INNER JOIN tblfixtures ON tblGameScore.GameNo = tblfixtures.GameNo " & _
"WHERE (((tblGameScore.GameNo)=[forms]![frmDataEntry]![GameNo])) "
CurrentDb.Execute strSQL, dbFailOnError
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
It works without the where clause.
I'm getting a "Too few parameters. Expected 1." message with this code, can anyone see why.
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Dim strSQL As String
strSQL = "INSERT INTO tblTeams ( TGameNo, TTeam, TFor, TAgainst )" & _
"SELECT tblGameScore.GameNo, tblfixtures.FTeam1, tblGameScore.For, tblGameScore.Against " & _
"FROM tblGameScore INNER JOIN tblfixtures ON tblGameScore.GameNo = tblfixtures.GameNo " & _
"WHERE (((tblGameScore.GameNo)=[forms]![frmDataEntry]![GameNo])) "
CurrentDb.Execute strSQL, dbFailOnError
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
It works without the where clause.