When the below code runs and there is no data, I get Error #3075 -- Syntax error (missing operator) in query expression '[CompanyID] = And [ActivityID] = 1'.
Public Function JobTotal(ByVal strActivity As Integer) As Integer
JobTotal = DCount("[ActivityID]", "Event", "[CompanyID]= " & Forms!frmViewJobList!txtCompanyID & " And " & _
"[ActivityID]= " & CStr(strActivity))
End Function
How can I resolve this when there are no record (no activity yet for this record) to total?
Public Function JobTotal(ByVal strActivity As Integer) As Integer
JobTotal = DCount("[ActivityID]", "Event", "[CompanyID]= " & Forms!frmViewJobList!txtCompanyID & " And " & _
"[ActivityID]= " & CStr(strActivity))
End Function
How can I resolve this when there are no record (no activity yet for this record) to total?