spaLOGICng
Member
- Local time
- Today, 11:45
- Joined
- Jul 27, 2012
- Messages
- 163
Hi, Hope this helps....
In VBA, this sample sets the Column named "ID" in Table named "Table4" to begin at 10, with increments of 10. The first argument is where it begins, the second argument is the increment.
CurrentDb.Execute "ALTER TABLE [Table4] ALTER COLUMN [ID] COUNTER(10,10)"
In this sample, it will start at 1000, and increment in steps of 2000
CurrentDb.Execute "ALTER TABLE [Table4] ALTER COLUMN [ID] COUNTER(1000,2000)"
You do not need all that fancy VBA. You can get creative, but you should not code more than you need to.
How to restart counting from 1 after erasing table in MS Access? - Stack Overflow
In VBA, this sample sets the Column named "ID" in Table named "Table4" to begin at 10, with increments of 10. The first argument is where it begins, the second argument is the increment.
CurrentDb.Execute "ALTER TABLE [Table4] ALTER COLUMN [ID] COUNTER(10,10)"
In this sample, it will start at 1000, and increment in steps of 2000
CurrentDb.Execute "ALTER TABLE [Table4] ALTER COLUMN [ID] COUNTER(1000,2000)"
You do not need all that fancy VBA. You can get creative, but you should not code more than you need to.
How to restart counting from 1 after erasing table in MS Access? - Stack Overflow