dmorgan20
dmorgan20

Reputation: 363

Dcount with multiple criteria

I am using the below VBA code on my form load but getting an error:

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

The error is:

Object doesn't support this property or method

Any suggestions on which part is causing this error?

Upvotes: 1

Views: 1255

Answers (1)

Gustav
Gustav

Reputation: 55816

If Label44 is a label and dates should of April 2016:

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

And do assign meaningful names to your controls.

Upvotes: 2

Related Questions