I get this error when i check and uncheck my checkbox.
The checkbox is located on a form and when it's checked it's supposed to feed data into a small table.
When i click on it. I get this "Error 3061. Too few parameters expected 1" What could be wrong here?
The checkbox is located on a form and when it's checked it's supposed to feed data into a small table.
When i click on it. I get this "Error 3061. Too few parameters expected 1" What could be wrong here?
Code:
Private Sub chkNoSupportHrs_AfterUpdate()
On Error GoTo Err_ChkBox_Click
Dim MySQL As String
If Me.chkNoSupportHrs Then
'-- CheckBox going to "Checked" state
MySQL = "Insert into tblNoSupportHrs(sID, WeekEnding)" & _
"Values(" & Me.txtResource & ", """ & Me.Text18 & """)"
Else
'-- CheckBox going to "UnChecked" state
MySQL = "DELETE * FROM tblNoSupportHrs WHERE sID = " & Me.txtResource
End If
CurrentDb().Execute MySQL, dbFailOnError
Exit_ChkBox_Click:
Exit Sub
Err_ChkBox_Click:
MsgBox "Error No: " & Err.Number & vbCr & _
"Description: " & Err.Description
Resume Exit_ChkBox_Click
End Sub