简体   繁体   English

Access 2007 表单中的 DLookup 错误

[英]DLookup Error within an Access 2007 Form

I have built a form "Main" based on a table "APL 8-14-2014" in Access 2007. The client has requested additional data within the same form "Main" not originally included in the original table "APL 8-14-2014".我在 Access 2007 中基于表“APL 8-14-2014”构建了一个表单“Main”。客户请求了原始表“APL 8-14- 2014 年”。

I built a query "OverallRankingQry" combining "Overall_Ranking" with the Primary Key "Project ID" originally included in the "APL 8-14-2014" Table.我构建了一个查询“OverallRankingQry”,将“Overall_Ranking”与最初包含在“APL 8-14-2014”表中的主键“Project ID”结合起来。

How do I pull this query into my expression builder in my form?如何将此查询拉入表单中的表达式构建器? I have attempted to write a dlookup with only the #NAME?我曾尝试仅使用#NAME 编写 dlookup? error result.错误结果。 I think I am not properly defining that current open Form's "ID" is equal to the "Project ID" within the query, but this is just a guess.我想我没有正确定义当前打开的表单的“ID”等于查询中的“项目 ID”,但这只是一个猜测。

Desired Field = Overall_Ranking From Query = OverallRankingQry Based on Criteria = "ID" in open Form will be equal to "Project ID" field within OverallRankingQry Desired Field = Total_Ranking From Query = OverallRankingQry 基于标准 = “ID”在打开的表单中将等于“Project ID”字段在 TotalRankingQry

=DLookUp([Overall_Ranking],[OverallRankingQry],"[ID]=[Form]![MAIN]")

It sounds like you are wanting to use the query builder for the form and create the join between your table and your new query.听起来您想对表单使用查询构建器并在表和新查询之间创建连接。 Hit the ellipses (...) and build the Record Source like you built the query, only include the original table and the new query you've written with a join between them on the ID.点击省略号 (...) 并像构建查询一样构建记录源,仅包含原始表和您编写的新查询,它们之间在 ID 上有连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM