具有现有记录的字段的自动编号 [英] Autonumber for a field with existing records

查看:63
本文介绍了具有现有记录的字段的自动编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你们这些人很棒!


我有一个索赔人大师具有称为索赔人ID的主键的表格。设置为数字数据类型。它有与巨大的工作相关联的现有记录。表。现有成千上万的条目,有些索赔人有几个条目。


我想保持现有条目不变,让数据库从现在起自动填写索赔人ID。可以这样做吗?它不会让我因为所有现有的条目而将其更改为自动编号。


是否可以查看最后一条记录的索赔人ID并添加一个数值它是以新的工作形式输入的形式吗?


有些重复项已从工作表中删除,因此即使只有2000个索赔人,最后一个索赔人的索赔人ID也可能是2030年(或比表中输入的索赔人数更多的数字)。我希望你能帮忙,因为我把头发拉了出来,看了很多帮助文件,这很不好笑。


我正在使用Access 2003.

Thnx deejow

U guys/gals are awesome!

I have a "Claimant Master" table with a primary key called "Claimant ID" set to number data type. It has existing records linked to an enormous "Jobs" table. There are thousands of existing entries and some Claimants have several entries.

I want to leave the existing entries untouched and get the database to fill in the Claimant ID automatically from now on. Can this be done? It won''t let me change it to autonumber because of all the existing entries.

Can it look to see what the last record has as its Claimant ID and add one numeric value to it in a form where new jobs are entered?

Some duplicates have been deleted from the Jobs table and therefore even if there are only 2000 claimants, the last claimant might have a claimant ID of 2030 (or a higher number than the ntotal number of claimants entered in the table). I hope you can help because I am pulling my hair out and have looked at so many help files it is not funny.

I am using Access 2003.

Thnx deejow

推荐答案


U guys / gals太棒了!

我有一个索赔人大师具有称为索赔人ID的主键的表格。设置为数字数据类型。它有与巨大的工作相关联的现有记录。表。现有成千上万的条目,有些索赔人有几个条目。


我想保持现有条目不变,让数据库从现在起自动填写索赔人ID。可以这样做吗?它不会让我因为所有现有的条目而将其更改为自动编号。


是否可以查看最后一条记录的索赔人ID并添加一个数值它是以新的工作形式输入的形式吗?


有些重复项已从工作表中删除,因此即使只有2000个索赔人,最后一个索赔人的索赔人ID也可能是2030年(或比表中输入的索赔人数更多的数字)。我希望你能帮忙,因为我把头发拉了出来,看了很多帮助文件,这很不好笑。


我正在使用Access 2003.

Thnx deejow
U guys/gals are awesome!

I have a "Claimant Master" table with a primary key called "Claimant ID" set to number data type. It has existing records linked to an enormous "Jobs" table. There are thousands of existing entries and some Claimants have several entries.

I want to leave the existing entries untouched and get the database to fill in the Claimant ID automatically from now on. Can this be done? It won''t let me change it to autonumber because of all the existing entries.

Can it look to see what the last record has as its Claimant ID and add one numeric value to it in a form where new jobs are entered?

Some duplicates have been deleted from the Jobs table and therefore even if there are only 2000 claimants, the last claimant might have a claimant ID of 2030 (or a higher number than the ntotal number of claimants entered in the table). I hope you can help because I am pulling my hair out and have looked at so many help files it is not funny.

I am using Access 2003.

Thnx deejow



请参阅此链接重置自动编号种子。即使您的情况不是由错误引起的,但补救措施仍然适用。

http://www.everythingaccess.com/tuto...ug-in-Jet-4.0)



大家好/加尔很棒!


我有一个索赔大师具有称为索赔人ID的主键的表格。设置为数字数据类型。它有与巨大的工作相关联的现有记录。表。现有成千上万的条目,有些索赔人有几个条目。


我想保持现有条目不变,让数据库从现在起自动填写索赔人ID。可以这样做吗?它不会让我因为所有现有的条目而将其更改为自动编号。


是否可以查看最后一条记录的索赔人ID并添加一个数值它是以新的工作形式输入的形式吗?


有些重复项已从工作表中删除,因此即使只有2000个索赔人,最后一个索赔人的索赔人ID也可能是2030年(或比表中输入的索赔人数更多的数字)。我希望你能帮忙,因为我把头发拉了出来,看了很多帮助文件,这很不好笑。


我正在使用Access 2003.

Thnx deejow
U guys/gals are awesome!

I have a "Claimant Master" table with a primary key called "Claimant ID" set to number data type. It has existing records linked to an enormous "Jobs" table. There are thousands of existing entries and some Claimants have several entries.

I want to leave the existing entries untouched and get the database to fill in the Claimant ID automatically from now on. Can this be done? It won''t let me change it to autonumber because of all the existing entries.

Can it look to see what the last record has as its Claimant ID and add one numeric value to it in a form where new jobs are entered?

Some duplicates have been deleted from the Jobs table and therefore even if there are only 2000 claimants, the last claimant might have a claimant ID of 2030 (or a higher number than the ntotal number of claimants entered in the table). I hope you can help because I am pulling my hair out and have looked at so many help files it is not funny.

I am using Access 2003.

Thnx deejow

  1. 索赔人主表是否通过[ClaimantID]字段链接到作业表,如同:[索赔人大师]。[ClaimantID](1)==> [工作]。[ClaimantID](MANY)?
  2. [ClaimantID]的具体数据类型是什么 - INTEGER,LONG?
  3. 以前生成的[ClaimantID]值是多少?
  4. 按顺序在索赔人主表中发布[ClaimantID]的最后12个值。


获取最后发布的ID(假设它增加了+1),你可以使用DMAX()函数。

只需设置新记录的ID字段的默认值,如:
To get the last issued ID (assuming it''s incremented by +1), you can use the DMAX() function.
Just set the default value for the ID field incase of a new record like:
展开 | 选择 | Wrap | 行号


这篇关于具有现有记录的字段的自动编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆