自动编号和输入掩码问题 [英] AutoNumber and Input Mask question

查看:64
本文介绍了自动编号和输入掩码问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将不是数字字段的字段设为自动编号?

我会尝试更好地解释。


我有掩码为AAA-00-000的字段,其中AAA是类别代码,第一组数字是年份(例如今年的07),最后一组数字是与类别代码和年份相关的自动编号(你应该能够拥有AAA-06-001,AAA-07-001和BAA-07-001)但是不要让人们自己查找下一个号码,一旦他们选择了它就会自动填充它会很好类别代码。


这可能吗?

解决方案

在表单上,​​在类别控件的AfterUpdate事件中,设置你的AAA-00-000字段的DefaultValue。

你可能需要使用Dmax()函数来获得最高的使用价值。


谢谢你非常喜欢这个指针。

我将在下周初讨论这个问题并报告它如何发生。



谢谢你非常喜欢这个指针。

我将在下周初解决这个问题并报告它是如何进行的。



我已经完成了这样的访问文件。

我有一个表格填充这种格式的自动编号:


HPES 07070001

前四个数字分别是年和月

然后最后四个是自动增加一个。


如果这是你想要的,我可以给你指点。


在你的表格上,确保你有一个自动编号字段。但是你不会使用这个字段来定制自动编号。它只是那里

作为你的记录的索引(主键)。


在你的表中,添加两个额外的字段,除了自动编号字段。

第一个字段应该是一个长整数作为格式的数字。

第二个字段应该是字符串。这是我们记录定制的

自动编号的地方。


现在,我假设您的表格将从交换机打开

在添加模式下。 (意思是,您不能转到其他记录,并且您在表单加载后立即转到新记录)


让我们说你命名第一个字段(数字字段) ) lngNum和第二个

字段(字符串字段)为 strID"。


在form_load()事件中添加此内容。


展开 | 选择 | Wrap | 行号

Is it possible to make a field that is not a number field into an auto number?
I shall try to explain better.

I have a field with the mask AAA-00-000 where AAA is a category code, the first set of numbers is the year (e.g. 07 for this year) and the final set of numbers is a auto number relating to both the category code and year (you should be able to have AAA-06-001, AAA-07-001 and BAA-07-001) but instead of having people look up the next number themselves it would be to nice to have it auto populate once they pick the category code.

Is this possible?

解决方案

On your form, in the AfterUpdate event of your category control, set the DefaultValue for your AAA-00-000 field.
You will probably need to use the Dmax() function to get the highest value in use.


Thank you very much for this pointer.
I will get around to this early next week and will report back on how it goes.


Thank you very much for this pointer.
I will get around to this early next week and will report back on how it goes.

I have done an access file like this.
I have a form populate an autonumber in this format:

HPES 07070001

where the first four numbers are the year and month respectively
then the last four are autonumbers incrementing by one.

If this is what you want, I can give you pointers.

on your tabel, make sure you have an autonumber field. But you would
not use this field for your customized autonumber. It''s just there
to be as an index (primary key) of your records.

in your table, add two additional fields aside from the autonumber field.
1st field should be a number with long integer as the format.
2nd field should be String. This is where we would record the customized
autonumber.

Now, I would assume that your form would be opened from a switchboard
in add mode. (meaning, you cannot go to other records and you you go to a new record as soon as the form loads)

let''s say you name the 1st field (the number field) " lngNum " and the second
field (string field) as " strID ".

Add this on your form_load() event.


Expand|Select|Wrap|Line Numbers


这篇关于自动编号和输入掩码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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