Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 06-19-2007, 07:45 AM
Novice
 
Join Date: Jun 2007
Posts: 1
fred2798
Send a message via Yahoo to fred2798
Default Adding an Outlook contact from my Access Database - Error 43

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
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -8. The time now is 08:30 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.