M
Margamo
Could someone please look at my code, I can direct the program to look
at the Access text box.
Private Sub cmdDeleteAppt_Click()
Dim olapp As Outlook.Application
Dim olfolder As Outlook.MAPIFolder
Dim colCalendar As Outlook.Items
Dim outappt As Outlook.AppointmentItem
Dim txtFind As String
Set olapp = CreateObject("Outlook.Application")
Set olfolder = olapp.GetNamespace("Mapi").GetFolderFromID("00000000F31B77B77395D5119EEB0000F805AF8F010055AD18F0018A874D86AA178D9A7B20BD000005ACB6F10000")
Set colCalendar = olfolder.Items
Forms!frmRecruitment.txtFullname2.SetFocus
txtFind = Forms!frmRecruitment.txtFullname2.Text
On Error GoTo cmdDeleteAppt_Err
outappt = colCalendar.Find([txtFind])
If Not outappt Is Nothing Then
outappt.Delete
End If
Set olapp = Nothing
Set olfolder = Nothing
Set colCalendar = Nothing
cmdDeleteAppt_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
End Sub
Thanks,
Margamo
at the Access text box.
Private Sub cmdDeleteAppt_Click()
Dim olapp As Outlook.Application
Dim olfolder As Outlook.MAPIFolder
Dim colCalendar As Outlook.Items
Dim outappt As Outlook.AppointmentItem
Dim txtFind As String
Set olapp = CreateObject("Outlook.Application")
Set olfolder = olapp.GetNamespace("Mapi").GetFolderFromID("00000000F31B77B77395D5119EEB0000F805AF8F010055AD18F0018A874D86AA178D9A7B20BD000005ACB6F10000")
Set colCalendar = olfolder.Items
Forms!frmRecruitment.txtFullname2.SetFocus
txtFind = Forms!frmRecruitment.txtFullname2.Text
On Error GoTo cmdDeleteAppt_Err
outappt = colCalendar.Find([txtFind])
If Not outappt Is Nothing Then
outappt.Delete
End If
Set olapp = Nothing
Set olfolder = Nothing
Set colCalendar = Nothing
cmdDeleteAppt_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
End Sub
Thanks,
Margamo