Hi,
I have written a function which sets the checkbox for all records in tbl_Questions to true.
I however only want the checkbox to be set to true for a specific record. Therefore a "where statement" was added to the earlier mentioned function. Unfortunately this leads to a run-time error.
Can anyone tell me what the problem might be?
See attachment for print screens
I have written a function which sets the checkbox for all records in tbl_Questions to true.
Code:
Function frm_1_Passage_Q1_Ja()
Dim strSQL As String
strSQL = "UPDATE tbl_Questions " _
& "SET tbl_Questions.Answer = True" _
CurrentDb.Execute strSQL, dbFailOnError
End Function
I however only want the checkbox to be set to true for a specific record. Therefore a "where statement" was added to the earlier mentioned function. Unfortunately this leads to a run-time error.
Code:
Function frm_1_Passage_Q1_Ja()
Dim strSQL As String
strSQL = "UPDATE tbl_Questions " _
& "SET tbl_Questions.Answer = True" _
& "Where tbl_Questions.ID = 1"
CurrentDb.Execute strSQL, dbFailOnError
End Function
Can anyone tell me what the problem might be?
See attachment for print screens