本文介绍了自动编号-指定起点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MS Access 2007

MS Access 2007

我正在尝试将AutoNumber设置为5,000,并为每个条目将其增加9.有什么办法吗?它不一定必须与AutoNumber一起使用,如果Access中有另一种方法可以做到这一点,那也很好.请帮忙.

I'm trying to start AutoNumber at 5,000 and increase it by 9 for each entry. Is there any way to do this? It doesn't have to be with AutoNumber, if there is another way in Access to do this, that would be great too. Please help.

推荐答案

您可以在ADO下使用DDL来设置自动编号种子和增量. (但是,呼应@ mwolfe02的评论……为什么?)

You can use DDL under ADO to set the autonumber seed and increment. (However, echoing @mwolfe02's comment ... why?)

Dim strSql as String
strSql = "ALTER TABLE YourTable ALTER COLUMN YourAutoNumberColumn COUNTER(5000, 9)"
CurrentProject.Connection.Execute strSql

还请参见前面的堆栈溢出问题是否对您有用:如何重置自动编号种子-MS Access/VB6

Also see if this previous Stack Overflow question is useful to you: How to reset autonumber seed - MS Access/VB6

这篇关于自动编号-指定起点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 01:16