我需要有关如何使表单自动生成数字的帮助 [英] I need help on how to make the form generate the number automatically

查看:89
本文介绍了我需要有关如何使表单自动生成数字的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一张表格。有一个字段名称ECO编号。

我希望这个字段生成阿尔法编号,如ECO-0001,ECO-0002等,当我舔一个按钮创建一个新记录时。你可以帮帮我吗?

谢谢

Hi,
I have a form. There is a field name ECO Number.
I want this field to generate the alpha number such as ECO-0001, ECO-0002 and so on when I lick on a button to create a new record. Could you please help me out?
Thanks

推荐答案

最简单的方法是在表格中使用自动编号字段类型。 ECO-将在运行时添加到查询,表单或报表中。


现在,如果需要确保序列号,我就不会使用它,在这种情况下,可以使用vba和简单的agregate查询返回字段中的最大数字,只需添加一个。


如果你在这里搜索Bytes.com,有几个Q& A'有这些信息可用于各种情况。
The easest is to simply use the autonumber field type in the table. The "ECO-" would be added at runtime either in the query, form, or report.

Now, I wouldn''t use this if you need to be assured of a sequential number, in which case, one can use vba and a simple agregate query to return the maximum of the number within a field and simply add one.

If you will search here on Bytes.com, there are several Q&A''s with this information available for various situations.


基本假设:
  1. 您的表名是tblECO,在此表中是一个名为[ECO Number] - {TEXT 8}的字段。
  2. [ECO-Number]必须是顺序的,不能为NULL(必需=是),是主键或表中的唯一索引,并且具有ECO-XXXX的确切格式。
  3. 字段([ECO编号])已经播种,这意味着至少有一个单个格式ECO-XXXX的值存在于其中。
  4. 以下公共函数将生成下一个唯一的,Se你的退出ECO号码。
  1. Your Table name is tblECO and in this Table is a Field named [ECO Number] - {TEXT 8}.
  2. [ECO-Number] must be sequential in nature, cannot be NULL (Required = Yes), is the Primary Key or is a Unique Index in the Table, and is of the exact Format of ECO-XXXX.
  3. The Field ([ECO Number]) is already seeded, meaning that at least a single Value of the Format ECO-XXXX exists in it.
  4. The following Public Function will generate the next Unique, Sequential ECO Number for you.
展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


ADezii,

感谢您的帮助。

我在MS Access上全新。

根据提供的信息,我应该在哪里输入它们?

谢谢
ADezii,
Thank you for your help.
I am totally new at MS Access.
With the provided information, where should I enter them?
Thanks


这篇关于我需要有关如何使表单自动生成数字的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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