本文介绍了如何检查另一个表中的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好, 我有一张主表输入乘客的个人资料,以及其他的通缉名单表,我需要输入乘客的名字主表我需要它在通缉列表表中首先检查名称,如果现有名称提供给我按摩说明他在通缉名单中, 如何通过VBA做到这一点,请指教亲爱的专家!!, 非常感谢提前!! MIsab
Hi All, I''ve a a main table to enter personal data of PASSENGER, and other table of WANTED LIST, I need while entering the name of the passenger in the main table I need it to check the name first in wanted list table, if the name is existing provide me a massage stating he is in the wanted list, How I can do that by VBA, please advise dear experts!!, Many thanks in Advance !! MIsab
推荐答案I可能会使用DCount()函数来计算其他中的记录数量。 table使用其WHERE子句指定只需要名字匹配的记录。然后,如果结果大于0,则至少有一个匹配项。以下是描述如何使用DCount()的链接: DCount功能。 I would probably use the DCount() function to count the number of records in your "other" table using its WHERE clause to specify that you want only the records where the first name matches. Then if the result is greater than 0 you have at least one match. Here is a link to describe how to use DCount(): DCount Function.
DLookup()可能更有意义。人们会认为标准是独特的。如果没有,那么无论如何都需要抛出一个匹配列表,并允许操作员从中选择或拒绝乘客。 DLookup() might make more sense. One would assume that the criteria are unique. If not then it would be necessary to throw up a list of matches anyway, and allow the operator to select or reject the passenger from it.
感谢您的回复!, 实际上我已经使用了Dcount和Dlookup两个函数,如下代码: Thanks both for your reply!!, actually i''ve did with the both function Dcount and Dlookup as following code: 展开 | 选择 | 换行 | 行号
更多推荐
如何检查另一个表中的字段
发布评论