K
kcm549
I've tried in vain to find help for my question... alas, I don't see my
problem described anywhere else.
I'm writing code. I'm looping through a recordset on a bound form. NO
record locking is on in the Options for the database, and no one else
is using it but me. So why on earth do I get an error when I try to run
the following code (MS Can't update all the records in the query due to
.... LOCK VIOLATIONS"? A2003, WinXP:
Dim rst As DAO.Recordset
Dim iNewNum As Integer
Dim sRS As String
Dim iOldNum As Integer
sRS = Me.RecordSource
iOldNum = Nz(txtIdx.OldValue, 0)
iNewNum = Nz(txtIdx, 0)
Set rst = CurrentDb.OpenRecordset(sRS) 'Will need to be able to
move both forward & backwards in this recordset
rst.MoveFirst
Do While Not rst.EOF 'for each row in the recordset
With rst
'*** ERROR OCCURS ON THE NEXT LINE ***
.Edit 'enter edit mode
!ord = upone 'make the change
.Update 'apply the change
End With 'exit edit mode
iNewNum = iNewNum + 1
End If
rst.MoveNext
etc...
Halp!
TIA, with weeping and wailing and gnashing of teeth...
Karen M.
problem described anywhere else.
I'm writing code. I'm looping through a recordset on a bound form. NO
record locking is on in the Options for the database, and no one else
is using it but me. So why on earth do I get an error when I try to run
the following code (MS Can't update all the records in the query due to
.... LOCK VIOLATIONS"? A2003, WinXP:
Dim rst As DAO.Recordset
Dim iNewNum As Integer
Dim sRS As String
Dim iOldNum As Integer
sRS = Me.RecordSource
iOldNum = Nz(txtIdx.OldValue, 0)
iNewNum = Nz(txtIdx, 0)
Set rst = CurrentDb.OpenRecordset(sRS) 'Will need to be able to
move both forward & backwards in this recordset
rst.MoveFirst
Do While Not rst.EOF 'for each row in the recordset
With rst
'*** ERROR OCCURS ON THE NEXT LINE ***
.Edit 'enter edit mode
!ord = upone 'make the change
.Update 'apply the change
End With 'exit edit mode
iNewNum = iNewNum + 1
End If
rst.MoveNext
etc...
Halp!
TIA, with weeping and wailing and gnashing of teeth...
Karen M.