Try this. You need a valid SQL statement that allows updates to your table (updateable recordset SQL where the red text is) and the name of the field (where the green text is):
[tt]
strSQL = “SELECT ….”
Set dbs = OpenDatabase(CurrentDb.Name)
Set qdf = dbs.CreateQueryDef("", strSQL)
Set rst= qdf.OpenRecordset(dbOpenDynaset)
If rst.BOF = False Then
rst.MoveLast
lngMaxRec = rst.RecordCount
rst.MoveFirst
Else
lngMaxRec = 0
End If
For i = 1 To lngMaxRec
With rst
.Edit
!RecRef = i
.Update
.Bookmark = .LastModified
End With
'-------------------
rst.MoveNext
Next i
rst.close
qdf.close
dbs.close
set rst = Nothing
set qdf = Nothing
set dbs = Nothing
Beep
Msgbox “End of update”
[/tt] [/tt] [/tt]
hth,
GGleason