By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,400 Members | 953 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,400 IT Pros & Developers. It's quick & easy.

progressive number

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.