Hi,
I am trying to update some fields in a table from a check box but i'm getting a "write conflict message" with 2 seperate bits of code. I have tried them on-click and after-update.
Dim strSQL1 As String
If (Me.Check1) Then
strSQL1 = "UPDATE tblKSF SET tblKSF.KSFGroup ='" & [Forms]![formmain]![FormSubKSF]![Group] & "', tblKSF.KSFDate = Date() " & _
"WHERE tblKSF.[Pay Number] ='" & [Forms]![formmain]![Text6] & "'"
CurrentDb.Execute strSQL1, dbFailOnError
and
If (Me.Check1) Then
'CurrentDb.Execute "UPDATE tblKSF SET tblKSF.KSFDate = Date() WHERE tblKSF.[Pay Number] ='" & Me![Pay Number] & "'"
CurrentDb.Execute "UPDATE tblKSF SET tblKSF.KSFGroup ='" & Me![Group] & "' WHERE tblKSF.[Pay Number] ='" & Me![Pay Number] & "'"
Else
CurrentDb.Execute "UPDATE tblKSF SET tblKSF.KSFDate = null WHERE tblKSF.[Pay Number] ='" & Me![Pay Number] & "'"
CurrentDb.Execute "UPDATE tblKSF SET tblKSF.KSFGroup = null WHERE tblKSF.[Pay Number] ='" & Me![Pay Number] & "'"
End If
End Sub
the code is updating the fields with the correct information but it's when I try to move away that the message comes.
Can anyone help me with this.
I am trying to update some fields in a table from a check box but i'm getting a "write conflict message" with 2 seperate bits of code. I have tried them on-click and after-update.
Dim strSQL1 As String
If (Me.Check1) Then
strSQL1 = "UPDATE tblKSF SET tblKSF.KSFGroup ='" & [Forms]![formmain]![FormSubKSF]![Group] & "', tblKSF.KSFDate = Date() " & _
"WHERE tblKSF.[Pay Number] ='" & [Forms]![formmain]![Text6] & "'"
CurrentDb.Execute strSQL1, dbFailOnError
and
If (Me.Check1) Then
'CurrentDb.Execute "UPDATE tblKSF SET tblKSF.KSFDate = Date() WHERE tblKSF.[Pay Number] ='" & Me![Pay Number] & "'"
CurrentDb.Execute "UPDATE tblKSF SET tblKSF.KSFGroup ='" & Me![Group] & "' WHERE tblKSF.[Pay Number] ='" & Me![Pay Number] & "'"
Else
CurrentDb.Execute "UPDATE tblKSF SET tblKSF.KSFDate = null WHERE tblKSF.[Pay Number] ='" & Me![Pay Number] & "'"
CurrentDb.Execute "UPDATE tblKSF SET tblKSF.KSFGroup = null WHERE tblKSF.[Pay Number] ='" & Me![Pay Number] & "'"
End If
End Sub
the code is updating the fields with the correct information but it's when I try to move away that the message comes.
Can anyone help me with this.