如何检查另一个表中的字段

编程入门 行业动态 更新时间:2024-10-26 00:18:21
本文介绍了如何检查另一个表中的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我有一张主表输入乘客的个人资料,以及其他的通缉名单表,我需要输入乘客的名字主表我需要它在通缉列表表中首先检查名称,如果现有名称提供给我按摩说明他在通缉名单中, 如何通过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: 展开 | 选择 | 换行 | 行号

更多推荐

如何检查另一个表中的字段

本文发布于:2023-10-15 00:50:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1492747.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!