Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
示例:我有三个表(地址、客户和付款)。我想计算折扣。但因此我需要知道每个地址有多少客户。我需要在我的付款表单中计算每个地址的客户,当我选择客户时,我想知道有多少客户住在这个地址上。如果我知道,那么我可以计算折扣。
您可以在文本框的控制源中使用 DCount,例如:
=DCount("ID","Customers","AddressID=" & AddressID)
以上将计算客户表中名为 ID 的字段,其中 AddressID 与表单当前记录上的 AddressID 相同。
这只是一个大纲,您必须使其适合您的设置。
或者,您可以创建一个查询客户地址并在查询上使用 DLookUp。