Pulling my hair out trying to update an appointment in Outlook. The code I am using stops running at this line.
Set objAppointmentItem = objAppointment.Items.Find("[Subject]=" & Forms!frmShowAllOutlookTasks_fromPopup_1!OLSubject)
this line and gives me an error code of -2147352567 Cannot parse condition. Error at "".
Debug shows me that the OLSubject is there but "Set objAppointmentItem = Nothing."
Using Access 2007
Can anybody tell me what I am going wrong?
Tanks for any help you can give me,
Richard M
Set objAppointmentItem = objAppointment.Items.Find("[Subject]=" & Forms!frmShowAllOutlookTasks_fromPopup_1!OLSubject)
this line and gives me an error code of -2147352567 Cannot parse condition. Error at "".
Debug shows me that the OLSubject is there but "Set objAppointmentItem = Nothing."
Using Access 2007
Can anybody tell me what I am going wrong?
Code:
Function UpdateOutlookAppointment()
On Error GoTo ErrorMsg
Dim objApp As Object
Dim objAppointmentItem As AppointmentItem
Dim objNS As NameSpace
Dim objAppointment As MAPIFolder
Dim objAppt As Object
Dim Subject As UserProperty
Dim RecordID As UserProperty
Dim taskID As UserProperty
Dim AppointmentType As UserProperty
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objAppointment = objNS.GetDefaultFolder(olFolderCalendar)
Debug.Print "first"
[COLOR=red]Set objAppointmentItem = objAppointment.Items.Find("[Subject]=" & Forms!frmShowAllOutlookTasks_fromPopup_1!OLSubject)[/COLOR]
Debug.Print "second"
Set objAppt = Forms![frmShowAllOutlookTasks_fromPopup_1]!OLSubject
Debug.Print "OK1"
Set AppointmentType = objAppointmentItem.UserProperties.Find(objAppt) '(objAppointmentItem)
Debug.Print "OK2"
Tanks for any help you can give me,
Richard M
Last edited: