I have a table which conatains DATE of Entry and Tick Box. I need to DCOUNT those tick boxes which are yes for the month of January from the field date of entry.
Dim MyCount As Long
MyCount = DCount("*", "[YourTableName]", _
"([Tick Box] = True) AND " & _
"(Year([DATE of Entry]) = Year(Date())) AND " & _
"(Month([DATE of Entry]) = 1)")
Dim MyCount As Long
MyCount = DCount("*", "[YourTableName]", _
"([Tick Box] = True) AND " & _
"(Year([DATE of Entry]) = Year(Date())) AND " & _
"(Month([DATE of Entry]) = 1)")
Thanks. With your help i manage to do it. But now i want to be filtered by COUNTER, becuase i want to dcount for specific user. I have add the COUNTER but its not working. Any help pls?
Dim MyCount As Long
MyCount = DCount("*", "[YourTableName]", _
"([Tick Box] = True) AND " & _
"(Year([DATE of Entry]) = Year(Date())) AND " & _
"(Month([DATE of Entry]) = 1) and " & _
" [Counter] = Forms![Personal Information]![Counter] ")