自动编号发生器(需要帮助) [英] Autonumber generator (help required)

查看:56
本文介绍了自动编号发生器(需要帮助)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

= NZ(DMax([SerialNo],Table1)+ 1,1)


这可以添加到表单字段/ properties / Data中默认值中的选项卡以生成自动编号。


请帮助在表中添加相同的默认值?其次,我们可以在特定数字后循环数字吗?例如如果我们想要达到8号;我们可以从序列号1开始下一个记录,然后再上升到8,再到1到8,依此类推......?


提前谢谢。

=NZ(DMax("[SerialNo]","Table1")+1,1)

This can be added in a form field / properties / Data tab in Default Value to generate auto number.

Please help to add the same in a table ''default value? Secondly, can we loop numbers after specific number? e.g. if we want to go up to number 8; can we start next record from serial no 1 and go up to 8 and again 1 to 8 and so on....?

Thanks in advance.

推荐答案

首先,你不能只在表格上的控件上以编程方式设置一个数字。


你的另一个问题是非常复杂,数据完整性非常糟糕。你究竟想做什么以及为什么?了解这将有助于设计解决方案。听起来好像你需要更改表结构。
Firstly you can''t set a number programmatically in the table only on a control on the form.

for your other question it would be extremely complicated to do and very bad for data integrity. What exactly are you trying to do and why? Knowing this would help to design a solution. It sounds as if you need to change your table structures.


感谢您的回复。


实际上我有另一张表,即员工表,其中包含8名员工。字段是员工编号,即1,2,3到8以及员工姓名。


现在第二个表即帐户表包含帐户持有人列表,即account_number,account_title和自动编号字段,即从1到8;再次1到8,依此类推,例如100条记录。


其实我想通过两个表(员工编号和自动编号字段)之间的关系将这100个帐户分配/分配给员工。如果帐户表包含所有记录的重复1到8,则可以这样做。
Thanks for reply.

Actually I have another table i.e. employee table that contains total 8 employees. Fields are employee numbers i.e.1, 2, 3 up to 8 and employee name.

Now the second table i.e. accounts table contains a list of account holders i.e. account_number, account_title and that autonumber field i.e. from 1 to 8; again 1 to 8 and so on for e.g. 100 records.

Actually I want to assign/ distribute these 100 accounts to the employees through relationship between the two tables (employee number and autonumber field). This can be possible if accounts table contains repetition of 1 to 8 for all records.


首先,我从您发布的内容中了解到您希望填充外键中的外键。帐户表,其中包含有8名员工的employeeID,并按比例分配。这可以作为现有数据的一次性例程来完成,但我不知道如何将其构建为现有例程。


对于一次性构建:

Firstly, I understand from what you''ve posted that you would like to populate a foreign key in the Accounts table with a reference to the employeeID of which there are 8 employees and distribute them apportionately. This can be done as a one off routine on existing data but I don''t see how it could be built as an existing routine.

For a one off build:

展开 | 选择 | Wrap | 行号


这篇关于自动编号发生器(需要帮助)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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