嗨,我在MS Access的表达式生成器中有一个dlookup
。
它涉及日期,当我运行它时,出现类型错误。
有什么想法吗?
=DLookUp("NewValue","[tblAuditTrail]","[frmName]='frmActionDetails' And ActionID='" & [Reports]![PATS_ACTIONID])
答案 0 :(得分:0)
假设字段ActionID
是字符串值,那么您会丢失连接值前后的单引号:
=DLookUp
(
"NewValue",
"[tblAuditTrail]",
"[frmName]='frmActionDetails' And ActionID='" & [Reports]![PATS_ACTIONID] & "'"
' You were missing this -----^
)
实际上,如果ActionID
包含数字值(对于ID可能是这样),则不需要引号,例如:
=DLookUp
(
"NewValue",
"[tblAuditTrail]",
"[frmName]='frmActionDetails' And ActionID=" & [Reports]![PATS_ACTIONID]
' Removed single quote from here -----^
)