如何防止输入重复值 [英] How to prevent entering duplicate value
问题描述
我的表?演员? 有以下这些字段:
cID(PK),cFName,cMName和cLName
我正在使用的表单更新此表称为fCast。
我想阻止两次输入相同的名称。为了防止两次输入相同的标题,我使用的是正常工作的代码。但我不知道如何连接3个字段并应用类似的代码。有人可以帮忙吗?谢谢。
防止重复标题的代码:
My Table ?Cast? has these fields:
cID (PK), cFName, cMName and cLName
The form I am using to update this table is called fCast.
I would like to prevent entering same name twice. To prevent entering same title twice I am using codes which is working. But I am not sure how to concatenate 3 fields and apply similar codes. Can someone please help? Thanks.
My code to prevent duplicating a title:
推荐答案
@MNNovice
确保没有2个名称的最简单方法,即First的组合名称,MI和姓氏用于创建由这3个字段组成的唯一索引(不允许重复)。如果您不确定如何操作,请告诉我们。
@MNNovice
The easiest Method of making sure that no 2 Names are exact, namely the combination of First Name, MI, and Last Name is to create a Unique Index (No Duplicates allowed) consisting of these 3 Fields. If you are not sure how to do this, just let us know.
@ADezii
我不知道怎么做做这个独特的索引。请告诉我。谢谢。
@ADezii
I do not know how to do this unique indexing. Please let me know. Thanks.
@MNNovice
@MNNovice
- 在设计视图中打开转换表。
- 点击查看==>索引。
- 在索引名称列下的第一个打开的行中,输入FullName。
- 在同一行中,选择字段名称列下的cFName。
- 在同一行中,设置此字段的排序顺序。
- 不离开此行,在索引属性集下:
- 主要=是
- 唯一=是
- 忽略空值=否
现在, Alfred E Newmann 将不允许两次进入这些领域,但 Alfred A Newmann 和 Alfred Newmann 将会。
Now, Alfred E Newmann will not be allowed to be entered into these Fields twice, but Alfred A Newmann and Alfred Newmann will.
这篇关于如何防止输入重复值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!