![]() |
|
|
#1
|
|||
|
|||
|
Hi Group
I am trying to add an outlook contact from my access database. This code is attached to the OnClick event of a command button and works fine….it adds the contact and enters in the full name. Problems start happening when I try to add additional fields within the WITH statement. I get an Error 438 message – Object doesn’t support this property or method. Does anyone have any ideas??? Thanks for your input Private Sub AddOLContact_Click() On Error GoTo AddAppt_Err 'Save record first to be sure required fields are filled. DoCmd.RunCommand acCmdSaveRecord 'Exit the procedure if appointment has been added to Outlook If Me!AddedToOutlook = True Then MsgBox "This appointment already added to Microsoft Outlook" Exit Sub 'Add a new appointment Else Dim outobj As Outlook.Application Dim outappot As Outlook.ContactItem Set outobj = CreateObject("outlook.application") Set outappt = outobj.CreateItem(olContactItem) With outappt FullName = Me.FName & " " & Me.LName Save End With End If 'Release the Outlook object variable Set outobj = Nothing 'Set the AddedToOutlook flag, save the record, display a message Me!AddedToOutlook = True DoCmd.RunCommand acCmdSaveRecord MsgBox "Contact Added!" Exit Sub AddAppt_Err: MsgBox "Error " & Err.Number & vbCrLf & Err.Description Exit Sub End Sub |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Access Contact Database | gpeterson82 | Access | 0 | 10-30-2008 07:38 AM |
| Database Login Error | narasareddy | Access | 0 | 08-29-2008 10:00 PM |
| Reading outlook tasks from Access | Bill_dom | Import/Export Data | 0 | 08-07-2008 04:02 PM |
| Access link to Microsoft Outlook | epallaron | Access | 0 | 09-19-2007 05:25 AM |
| Access database closes with error report each time I update | kimberliegeorge | Access | 1 | 12-09-2005 06:16 PM |