Carlo wrote:
I have a table with a lot of fields. One is a numeric field.
How can I introduce in these field a progressive number.
I have to change at times the start number.
example:
55,56,57,58,59,60,134,135,136,137
Create a table, add a numeric field. Maybe call the table LastAction.
In it you can store the last time you did an update, last time a report
was run, etc. Now you have a field to hold an incrementer.
'update your field with a new progressive. I would do this when the
record is SAVED, otherwise you can end up with some skips unless when
you undo you decrement the number
Sub UpdateProgressive()
Dim rst As DAO.Recordset
set rst = Currentdb.OpenRecordset("LastAction")
rst.Edit
rst!Progressive = rst!Progressive + 1
rst.Update
Me.Progressive = rst!Progressive
rst.Close
set rst = Nothing
End Sub
'pass to this sum the new progressive number
Sub UpdateProgressive(lngNum As Long)
Dim rst As DAO.Recordset
set rst = Currentdb.OpenRecordset("LastAction")
rst.Edit
rst!Progressive = lngNum
rst.Update
rst.Close
set rst = Nothing
End Sub