I'm having trouble getting the Find or FindFirst methods to work in Access 2000.
Here's what I'm doing. I'm comparing the items in my Outlook calendar with a table in Access, where both of them have similar fields, and I'm using the EntryID field to compare them. However, when I run the code, I get an error at the line in bold below, of "Operation is not supported for this type of object."
However, the FindFirst method does appear in the list of methods and properties whenever I type
rsCalendar.
So, why is that error occurring? Any help would be appreciated. Here's my code snippet:
Dim objOlApp As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objCalendar As Outlook.MAPIFolder
Dim objCalendarItems As Outlook.Items
Dim rsCalendar As DAO.Recordset
dim objAppointment as Outlook.AppointmentItem
Set objOlApp = CreateObject("Outlook.Application"
Set objNameSpace = objOlApp.GetNamespace("MAPI"
Set objCalendar = objNameSpace.GetDefaultFolder(olFolderCalendar)
Set objCalendarItems = objCalendar.Items
Set rsCalendar = CurrentDb.OpenRecordset("Calendar"
rsCalendar.MoveFirst
For Each objAppointment In objCalendarItems
rsCalendar.FindNext "EntryID = '" & objAppointment.EntryID & "'"
If Not rsLHDCalendar.EOF Then
MsgBox "Found appointment for " & objAppointment.Subject & _
" on " & objAppointment.Start " in Calendar table."
Else
MsgBox "No entry found for " & objAppointment.Subject & _
" on " & objAppointment.Start " in Calendar table."
End If
Next
Here's what I'm doing. I'm comparing the items in my Outlook calendar with a table in Access, where both of them have similar fields, and I'm using the EntryID field to compare them. However, when I run the code, I get an error at the line in bold below, of "Operation is not supported for this type of object."
However, the FindFirst method does appear in the list of methods and properties whenever I type
rsCalendar.
So, why is that error occurring? Any help would be appreciated. Here's my code snippet:
Dim objOlApp As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objCalendar As Outlook.MAPIFolder
Dim objCalendarItems As Outlook.Items
Dim rsCalendar As DAO.Recordset
dim objAppointment as Outlook.AppointmentItem
Set objOlApp = CreateObject("Outlook.Application"
Set objNameSpace = objOlApp.GetNamespace("MAPI"
Set objCalendar = objNameSpace.GetDefaultFolder(olFolderCalendar)
Set objCalendarItems = objCalendar.Items
Set rsCalendar = CurrentDb.OpenRecordset("Calendar"
rsCalendar.MoveFirst
For Each objAppointment In objCalendarItems
rsCalendar.FindNext "EntryID = '" & objAppointment.EntryID & "'"
If Not rsLHDCalendar.EOF Then
MsgBox "Found appointment for " & objAppointment.Subject & _
" on " & objAppointment.Start " in Calendar table."
Else
MsgBox "No entry found for " & objAppointment.Subject & _
" on " & objAppointment.Start " in Calendar table."
End If
Next