A
Alastair MacFarlane
Dear All,
I have created a after_update event on a Yes/No CheckBox which searches
through a recordset clone of the form and updates related records. When I run
the code below, which works, I get the message: "Another user has made
changes to the record. Do you wsh to save changes, drop or cancel?" How can I
ensure that this message does not pop up?
I understand why this message appears but not how to stop it from appearing?
Private Sub Include_AfterUpdate()
Dim rst As DAO.Recordset
Dim bvBookmark As String
Dim SearchCriteria As String
If Me!Include = True Then
bvBookmark = Me.Bookmark
Set rst = Me.RecordsetClone
With rst
.MoveFirst
SearchCriteria = "[FirstNames] = '" & Me!FirstNames & "' And
[LastName] = '" & Me![LastName] & "'"
.FindFirst SearchCriteria
Do Until .NoMatch
.Edit
!Include = True
.Update
.FindNext SearchCriteria
Loop
End With
Set rst = Nothing
Me.Refresh
Me.Bookmark = bvBookmark
End If
End Sub
I have created a after_update event on a Yes/No CheckBox which searches
through a recordset clone of the form and updates related records. When I run
the code below, which works, I get the message: "Another user has made
changes to the record. Do you wsh to save changes, drop or cancel?" How can I
ensure that this message does not pop up?
I understand why this message appears but not how to stop it from appearing?
Private Sub Include_AfterUpdate()
Dim rst As DAO.Recordset
Dim bvBookmark As String
Dim SearchCriteria As String
If Me!Include = True Then
bvBookmark = Me.Bookmark
Set rst = Me.RecordsetClone
With rst
.MoveFirst
SearchCriteria = "[FirstNames] = '" & Me!FirstNames & "' And
[LastName] = '" & Me![LastName] & "'"
.FindFirst SearchCriteria
Do Until .NoMatch
.Edit
!Include = True
.Update
.FindNext SearchCriteria
Loop
End With
Set rst = Nothing
Me.Refresh
Me.Bookmark = bvBookmark
End If
End Sub