Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access to Outlook Calender Error 438

Status
Not open for further replies.

ali32j

Technical User
Apr 23, 2007
97
GB
Hi All

I have the following code entering appointments into outlook from a command click on an access form. I have managed to get it working perfectly on my home laptop, running Access 2007, when i ve transfered to my laptop i am getting the following error:

Error 438
Object doesn't support this property or method

ANyone have any ideas why it works on one not the other??

Private Sub Command158_Click()


On Error GoTo Add_Err

DoCmd.RunCommand acCmdSaveRecord

If Me!addedtooutlook = True Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmOutlookCheck"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub

Else
Dim objOutlook As Object ' Outlook.Application
Dim objAppt As Object ' Outlook.AppointmentItem

Const olAppointmentItem = 1

Set objOutlook = CreateObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(olAppointmentItem)


With objAppt
.Start = Me!AppointmentDate & " " & Me!AppointmentTime
.Subject = Me![Name 1] & " - " & Me!AppointmentContact & " - " & Me![Sales District]


If Not IsNull(Me!PartnerID) Then .Location = "Customer Site -" & " " & Me!City
.Duration = Me.Text165
.Save

End With

Set objAppt = Nothing
End If

Set objOutlook = Nothing

Me!addedtooutlook = True
DoCmd.RunCommand acCmdSaveRecord

MsgBox "Appointment Added!"

Exit Sub

Add_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
Exit Sub

End Sub

Many thanks

Ali
 
BY the way, work laptop is running office 2003
 
Which line of code raises the error ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV

It doesnt reference any specific line of code, it just pops up the error message...

Ali
 
Which line of code is highlighted when pressing the Debug button ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
HI PHV

Debug is not an option, The error message pops up and only has a OK button....

ALi
 
The code compiles fine as well...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top