问题描述
我需要为我的业务密钥自动生成一个 12 个字符的值.无需任何用户交互.
I need to automatically generate a 12 character value for my Business Key. Without any user interaction.
8 character -> Today Date (yyyymmdd or ddmmyyyy).
+
4 character -> Sequential Number (0001,0002,0003).
必须在每个新的一天重新设置序列号.
The Sequential Number must reset on each new day.
是否可以在不涉及任何编码的情况下在 Microsoft Access 2010+ 中执行此操作?
Is it possible to do this in Microsoft Access 2010+ without any coding involved?
推荐答案
由于您使用的是 Access 2010+,实现目标的最佳方法是使用像这样的 Before Change 数据宏
Since you are using Access 2010+ the best way to accomplish your goal would be to use a Before Change data macro like this
要创建更改前宏,请在数据表视图中打开表格时单击功能区表格"选项卡上的更改前"按钮:
To create the Before Change macro, click the "Before Change" button on the "Table" tab of the ribbon when the table is open in Datasheet View:
有关数据宏的更多详细信息,请参阅
For more details on Data Macros see
这篇关于在 Access 2010+ 中为 ID 自动生成日期 + 4 位序列号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!