I am using the below code to fill some information. I keep having write conflicts and Error 3188 with this form; therefore, I am wondering is there a better way of getting this information?
Code:
Private Sub Form_Load()
Me!txtAuthorizations = ActivityCount(1)
Me!txtAttachments = ActivityCount(2)
Me!txtHostedJobFair = ActivityCount(3)
Me!txtPhoneCalls = ActivityCount(19)
Me!txtConductedInterviews = ActivityCount(8) + ActivityCount(9) + ActivityCount(10) + ActivityCount(11)
Me!txtMeeting = ActivityCount(16)
Me!txtNotes = ActivityCount(17)
Me!txtClientComplaints = ActivityCount(18)
Me!txtConductingPhoneInterviews = ActivityCount(21)
Me!txtSearchedOnline = ActivityCount(24)
Me!txtSends = ActivityCount(5) + ActivityCount(7) + ActivityCount(15)
Me!txtTesting = ActivityCount(25)
Me!txtToDos = ActivityCount(27)
Me!txtTraining = ActivityCount(28)
End Sub
Public Function ActivityCount(ByVal strEventType As Integer) As Integer
ActivityCount = DCount("[ActivityID]", "Event", _
"[CompanyID] = " & Forms!frmViewEventHistory!txtCompanyID & " And " & _
"[ActivityID] = " & strEventType)
End Function