创建特定的唯一序列号 [英] Create Specific Unique Serial Number

查看:70
本文介绍了创建特定的唯一序列号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Access 2003,我需要创建一个自动序列号。

示例" 7235-E001"

" 7"是当年

" 235"是白天

" -E"是静态的

" 001"是顺序的,在001处重新开始。每天


我设置一个表格字段,其中= right(格式(现在(),yy)&格式(格式(现在(),y) ),QUOT; 000"),4)"创建年/日数.----我应该能够添加&" -E"&添加静态-E----我试图将这一切与自动编号一起添加,但这显然是失败的,因为自动编号不会每天重置。此外,我在序号001上丢失了占位符。


我对VB几乎一无所知,如果可能,我希望将所有表达式都保留在查询和表格和表格。如果不可能,我会看到我能理解的东西。


请记住,我是一个完整的菜鸟,所以跟我说话就像我是个白痴。谢谢。

Using Access 2003, I need to create an automatic Serial Number.
Example "7235-E001"

"7" is current year
"235" is day
"-E" is static
"001" is sequencial, restarting at "001" each day

I set a table field with "=right(Format(Now(),"yy") & Format(Format(Now(),"y"),"000"),4)" to create the year/day number.----I should be able to add &"-E"& to add the static "-E"----I tried to add this all together with the "autonumber", but that obviously failed since the autonumber will not reset each day. Also, I lost the placeholders on the sequencial number "001".

I have little to no knowledge of VB, and if possilbe, would like to keep all expressions regulated to queries and tables and forms. If not possible, I will see what I can understand.

Please keep in mind, I am a complete noob, so speak to me like I am an idiot. Thank you.

推荐答案


使用Access 2003,我需要创建一个自动序列号。

示例7235-E001


" 7"是当年

" 235"是白天

" -E"是静态的

" 001"是顺序的,在001处重新开始。每天


我设置一个表格字段,其中= right(格式(现在(),yy)&格式(格式(现在(),y) ),QUOT; 000"),4)"创建年/日数.----我应该能够添加&" -E"&添加静态-E----我试图将这一切与自动编号一起添加,但这显然是失败的,因为自动编号不会每天重置。此外,我在序号001上丢失了占位符。


我对VB几乎一无所知,如果可能,我希望将所有表达式都保留在查询和表格和表格。如果不可能,我会看到我能理解的东西。


请记住,我是一个完整的菜鸟,所以跟我说话就像我是个白痴。谢谢。
Using Access 2003, I need to create an automatic Serial Number.
Example "7235-E001"

"7" is current year
"235" is day
"-E" is static
"001" is sequencial, restarting at "001" each day

I set a table field with "=right(Format(Now(),"yy") & Format(Format(Now(),"y"),"000"),4)" to create the year/day number.----I should be able to add &"-E"& to add the static "-E"----I tried to add this all together with the "autonumber", but that obviously failed since the autonumber will not reset each day. Also, I lost the placeholders on the sequencial number "001".

I have little to no knowledge of VB, and if possilbe, would like to keep all expressions regulated to queries and tables and forms. If not possible, I will see what I can understand.

Please keep in mind, I am a complete noob, so speak to me like I am an idiot. Thank you.

我只能在这上花很短的时间,但是这个功能应该按照你的规格正确生成下一个序列号。只有几个简单的假设:

  1. 您的表名是tblTest,必要时进行适当的替换。
  2. 此表中的[SerialNo]字段称为[SerialNo]。
  3. 您在序列号中引用的Day组件是Julian日期(从第一年开始的天数) 。
  4. 如有任何问题,请随时询问。
  1. Your Table Name is tblTest, make the appropriate substitution if necessary.
  2. The [SerialNo] Field within this Table is called [SerialNo].
  3. The Day component you refer to in the Serial Number is a Julian Date (number of Days from the first of the year).
  4. Any questions, feel free to ask.
展开 | 选择 | Wrap | 行号


这就是我的样子害怕。我不知道将VB放在数据库中的哪个位置。
This is kind of what I was afraid of. I have no idea where I would put the VB in the database.



这是我所害怕的。我不知道我将VB放在数据库中的哪个位置。
This is kind of what I was afraid of. I have no idea where I would put the VB in the database.



= fGenerateNextSerialNumber()放在[序列号]字段的默认值属性中。无论何时添加新记录,此函数的结果都将放在此字段中。

Place =fGenerateNextSerialNumber() in the Default Value Property of the [Serial Number] Field. Anytime you add a New Record, the results of this Function will be placed in this Field.


这篇关于创建特定的唯一序列号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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