The following macro opens the table "tblClaimsShort", which has about 170,000 records. Access crashes (my system freezes and Access shuts down) everytime I run the macro - but only after every 10,000 records or so that are properly updated. Can anyone see what may be wrong with my code - or, more importantly, how I might be able to pre-empt Access crashes in general. I am new to Access, but I manage to crash Access with incredible frequency (about 15 to 20 times a day!!) during almost all my attempts at running macros.
Thank you for any help.
Jim
Sub Truncate_SS()
'This Macro truncates the last two numbers appended to _
the Social Security Number
Dim rs As ADODB.Recordset
Dim iCount As Long
On Error GoTo ShowError_Err
Set rs = New ADODB.Recordset
With rs
.ActiveConnection = CurrentProject.Connection
.CursorType = adOpenKeyset 'Permits changing of source records
.LockType = adLockOptimistic
'.CursorLocation = adUseClient
'.Open "Select EeSS from tblClaimsShort ", Options:=adCmdText
.Open "Select EeSS from tblClaimsShort"
End With
rs.MoveFirst
rs.Move (145000)
Do Until rs.EOF
iCount = rs.AbsolutePosition
rs("EeSS"
= Left(rs("EeSS"
, 9)
rs.MoveNext
Loop
GoTo Line99
ShowError_Err:
MsgBox "Error Detected with rs = " & iCount, , "Error Detected"
rs.Close
Set rs = Nothing
Line99:
End Sub
Thank you for any help.
Jim
Sub Truncate_SS()
'This Macro truncates the last two numbers appended to _
the Social Security Number
Dim rs As ADODB.Recordset
Dim iCount As Long
On Error GoTo ShowError_Err
Set rs = New ADODB.Recordset
With rs
.ActiveConnection = CurrentProject.Connection
.CursorType = adOpenKeyset 'Permits changing of source records
.LockType = adLockOptimistic
'.CursorLocation = adUseClient
'.Open "Select EeSS from tblClaimsShort ", Options:=adCmdText
.Open "Select EeSS from tblClaimsShort"
End With
rs.MoveFirst
rs.Move (145000)
Do Until rs.EOF
iCount = rs.AbsolutePosition
rs("EeSS"
rs.MoveNext
Loop
GoTo Line99
ShowError_Err:
MsgBox "Error Detected with rs = " & iCount, , "Error Detected"
rs.Close
Set rs = Nothing
Line99:
End Sub