Hi
I am trying to send tasks to other people using access vba. I had used before in my database but was using early binding and now through version issues of office I am trying to recreate the code using late binding, however I am getting various problems with certain lines of code.
Primarily .datedue line I am getting run time error 438 objext does not support
Below is my code, could someone please point me in the direction for advice or even correct my attempt
Public Sub ASB5PostponedTask()
Dim olApp As Object
Dim olTask As Object
Dim olDateEnd As Date
Dim ToContact As Object
Dim olTaskOwner As String
olTaskOwner = "e.grainger"
Set olApp = CreateObject("outlook.application")
Set olTask = olApp.CreateItem(3)
olDateEnd = Forms!frmasb5details.JobDetsActualStartDate
olTask.subject = "ASB5 Postponed For Enquiry " & Forms!frmasb5details.EnquiryNumberID & " " & Forms!frmasb5details.JobDetsSiteAdd1 & " Adjust Air Test booking As Applicable"
olTask.body = "Adjust Date For Air Test As Required"
With olTask
.recipients.Add ("ldsaccounting@sky.com")
.Owner = olTaskOwner
.ReminderSet = True
.Importance = 2
.datedue = olDateEnd
.Save
.display
End With
End Sub
Many thanks
Richard
I am trying to send tasks to other people using access vba. I had used before in my database but was using early binding and now through version issues of office I am trying to recreate the code using late binding, however I am getting various problems with certain lines of code.
Primarily .datedue line I am getting run time error 438 objext does not support
Below is my code, could someone please point me in the direction for advice or even correct my attempt
Public Sub ASB5PostponedTask()
Dim olApp As Object
Dim olTask As Object
Dim olDateEnd As Date
Dim ToContact As Object
Dim olTaskOwner As String
olTaskOwner = "e.grainger"
Set olApp = CreateObject("outlook.application")
Set olTask = olApp.CreateItem(3)
olDateEnd = Forms!frmasb5details.JobDetsActualStartDate
olTask.subject = "ASB5 Postponed For Enquiry " & Forms!frmasb5details.EnquiryNumberID & " " & Forms!frmasb5details.JobDetsSiteAdd1 & " Adjust Air Test booking As Applicable"
olTask.body = "Adjust Date For Air Test As Required"
With olTask
.recipients.Add ("ldsaccounting@sky.com")
.Owner = olTaskOwner
.ReminderSet = True
.Importance = 2
.datedue = olDateEnd
.Save
.display
End With
End Sub
Many thanks
Richard