在表单上输入时自动递增链接表的ID字段 [英] Auto Increment ID field of Linked table when entering on Form

查看:44
本文介绍了在表单上输入时自动递增链接表的ID字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为dbo_problems的链接表。我有一个使用dbo_problems的表单。作为其数据来源。链接表dbo_problems有一个名为ID的字段这是一个数字。此字段需要一个值,当我输入新记录时,我希望ID字段使用最后一个记录ID + 1.例如,如果输入的最后一个记录ID是17586,那么如果输入了新记录ID将自动计算并且为17587。这是(17586 + 1)。


我有办法实现这个目标吗?任何想法,建议或帮助将不胜感激。提前谢谢。


问候,


Catalyst

I have a linked table called "dbo_problems". I have a form that uses "dbo_problems" as its data source. The linked table "dbo_problems" has a field called "ID" which is a Number. This field requires a value and when I enter a new record I want the ID field to use the last record ID + 1. So for example if the last record ID that was entered was "17586", then if a new record was entered the ID would automatically be calculated and be "17587" which is (17586 + 1).

Is there a way that I can accomplish this? Any ideas, suggestions or help would be greatly appreciated. Thank you in advance.

Regards,

Catalyst

推荐答案

你可以只使用自动增量字段而不是计算它。
You could just use an auto increment field instead of calculating it.


我无法对表设计进行任何更改,因为它是一个源自SQL Server的链接表。这就是我尝试这样做的原因。
I can not make any changes to the table design because it is a linked table sourced from a SQL Server. That is why I am trying to do it this way.


然后你可以使用DMax()函数来获取最后一个数字然后再添加1。
Then you can use DMax() function to get the last number and then add 1 to that.


这篇关于在表单上输入时自动递增链接表的ID字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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