具有多个条件的 Dcount

Dcount with multiple criteria

我在我的表单加载中使用了下面的 VBA 代码,但出现错误:

Text9.Value = DCount("[Advisors]", "[tbl_ComplaintsCodedl]", "[Advisors] = '" & [Label44] & "' AND [Date] between #01/04/2016# AND #30/04/2016#")

错误是:

Object doesn't support this property or method

关于哪个部分导致此错误的任何建议?

如果 Label44 是标签并且日期应该是 2016 年 4 月:

Text9.Value = DCount("*", "[tbl_ComplaintsCodedl]", "[Advisors] = '" & [Label44].Caption & "' And [Date] Between #2016/04/01# And #2016/04/30#")

并为您的控件指定有意义的名称。