访问VBA DMin多重条件,类型不匹配错误

时间:2018-10-31 19:38:29

标签: vba ms-access

我想找到当前用户不拥有且没有日期的最小ID值。前两个语句有效,但是当我将它们合并在一起时会出现不匹配错误。 ID为键,userid为字符串,intialreviewdate为日期,logid为long。

logid = DMin("ID", "tbl_QRCLDB_data", "[IntialReviewDate] Is Null")
logid = DMin("ID", "tbl_QRCLDB_data", "[CommLogOwner]<> '" & UserID & "'")
logid = DMin("ID", "tbl_QRCLDB_data", "[CommLogOwner]<>'" & UserID & "'" And " 
[IntialReviewDate] is Null")

感谢任何指导或建议。谢谢。

1 个答案:

答案 0 :(得分:0)

logid = DMin("ID", "tbl_QRCLDB_data", "[CommLogOwner]<>'" & UserID & "' And  
[IntialReviewDate] is Null")