CharlesHerrick
Registered User.
- Local time
- Today, 14:01
- Joined
- Oct 28, 2003
- Messages
- 20
I'm getting random warning messages in a single-user Access 2000 application involving a multiselect list box (lstRegion), where the user can select more than one item from the list (thanks to MikeAngelastro for the suggesion). I need to save the user selections in a table, to be used in another part of the application that will be run several days later. The table gets updated okay in spite of the warnings.
The message reads: "The data has changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record."
I can click the various selections several times with no problem, then the error pops up seemingly at random. I've tried setting the form's Record Locks property to both No Locks and Edited Record.
Here's the code:
Dim rs As Recordset, ctl As Control, I As Integer, db As Database
Set db = CurrentDb
Set rs = db.OpenRecordset("tblRegion", dbOpenDynaset)
Set ctl = Me!lstRegion
rs.MoveFirst
For I = 0 To ctl.ListCount - 1
rs.Edit
If ctl.Selected(I) Then
rs!blnStatePick = True
Else
rs!blnStatePick = False
End If
rs.Update
rs.MoveNext
Next I
I've also tried wrapping an Edit/Update statement pair around each field change, like this:
rs.Edit
rs!blnStatePick = True
rs.Update).
Does anyone have any ideas on this? Thanks.
The message reads: "The data has changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record."
I can click the various selections several times with no problem, then the error pops up seemingly at random. I've tried setting the form's Record Locks property to both No Locks and Edited Record.
Here's the code:
Dim rs As Recordset, ctl As Control, I As Integer, db As Database
Set db = CurrentDb
Set rs = db.OpenRecordset("tblRegion", dbOpenDynaset)
Set ctl = Me!lstRegion
rs.MoveFirst
For I = 0 To ctl.ListCount - 1
rs.Edit
If ctl.Selected(I) Then
rs!blnStatePick = True
Else
rs!blnStatePick = False
End If
rs.Update
rs.MoveNext
Next I
I've also tried wrapping an Edit/Update statement pair around each field change, like this:
rs.Edit
rs!blnStatePick = True
rs.Update).
Does anyone have any ideas on this? Thanks.