I have the following piece of code that updates a field in a table with a selected value from a list box
Dim varItm As Variant
If IsNull(Me.tb_Other1) Then
DoCmd.RunSQL "UPDATE Tbl_Section_1 SET Tbl_Section_1.ProgUsed =" & Me.Lb_Programmes.ItemData(varItm) & _
" Where" & [Tbl_Section_1]![UniqueID] = Me.Tb_UniqueId
Else
DoCmd.RunSQL "UPDATE Tbl_Section_1 SET Tbl_Section_1.ProgUsed =" & Me.tb_Other1 & _
" Where" & [Tbl_Section_1]![UniqueID] = Me.Tb_UniqueId
End If
When run a run time error 2465 is returned. I think it is to do with the Where clause of the statement.
Dim varItm As Variant
If IsNull(Me.tb_Other1) Then
DoCmd.RunSQL "UPDATE Tbl_Section_1 SET Tbl_Section_1.ProgUsed =" & Me.Lb_Programmes.ItemData(varItm) & _
" Where" & [Tbl_Section_1]![UniqueID] = Me.Tb_UniqueId
Else
DoCmd.RunSQL "UPDATE Tbl_Section_1 SET Tbl_Section_1.ProgUsed =" & Me.tb_Other1 & _
" Where" & [Tbl_Section_1]![UniqueID] = Me.Tb_UniqueId
End If
When run a run time error 2465 is returned. I think it is to do with the Where clause of the statement.