Hi
Im using a chkbox on a form (the form is a popup based on a query) . to update the table I use following code.
Private Sub chkSelect_Click()
Dim strAfdanceId As Byte
strAfdansid = Me.txtdanceId
If Me.chkSelect.Value = -1 Then
DoCmd.RunSQL "UPDATE TAfdansen SET TAfdansen.[Selecteer] = True WHERE TAfdansen.[Afdansid] = " & strAfdansid & ""
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Requery
End If
If Me.chkSelect.Value = 0 Then
DoCmd.RunSQL "UPDATE TAfdansen SET TAfdansen.[Selecteer] = False WHERE TAfdansen.[Afdansid] = " & strAfdansid & ""
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Requery
End If
When I select the chkbox I get a write conflict message???
see attachment
I think it has somthing to do that the query (source of the form) look at the same table I want to update?? is this correct??
if so...Does anybody knows how to get around this problem
thx
Al
Im using a chkbox on a form (the form is a popup based on a query) . to update the table I use following code.
Private Sub chkSelect_Click()
Dim strAfdanceId As Byte
strAfdansid = Me.txtdanceId
If Me.chkSelect.Value = -1 Then
DoCmd.RunSQL "UPDATE TAfdansen SET TAfdansen.[Selecteer] = True WHERE TAfdansen.[Afdansid] = " & strAfdansid & ""
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Requery
End If
If Me.chkSelect.Value = 0 Then
DoCmd.RunSQL "UPDATE TAfdansen SET TAfdansen.[Selecteer] = False WHERE TAfdansen.[Afdansid] = " & strAfdansid & ""
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Requery
End If
When I select the chkbox I get a write conflict message???

see attachment
I think it has somthing to do that the query (source of the form) look at the same table I want to update?? is this correct??
if so...Does anybody knows how to get around this problem
thx
Al