自定义用户自动编号 [英] Custom user autonumber
本文介绍了自定义用户自动编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在寻找解决此自动编号问题的方法.似乎没有确定的答案.
I have been searching for a solution to this autonumber problem that I am having. There seems to be no definite answer anywhere.
我有一个带有文本字段的表格.
I have a form which has a text field.
我希望此表单显示表格中字段的下一个数字.
I want this form to display the next number from a field in a table.
示例:该表包含3条记录,其值分别为D001,D002,D003
Example: the table contains 3 records with the values D001, D002, D003
该表格用于输入新记录(新数据).因此,下次我输入数据时,我希望D004以表格的形式自动显示在文本框中,以显示数据代码.
The form is used to enter new records (new data). So next time I enter data I want D004 to automatically show up on the text field for data code in the form.
这怎么办?
推荐答案
您可以使用以下形式的BeforeInsert事件:
You can use the BeforeInsert event of the form:
Me!AutoNumber.Value = Format(Val(Nz(Right(DMax("[AutoNumber]", "[YourTable]"), 3), 0)) + 1, "\D000")
这篇关于自定义用户自动编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文