KAT said:
is it possible to link you outlook calendar to an access database form if so
how do you do it. I want to be able to enter a date on the form have show on
my calendar so when the date pops up an alert shows up on my calendar that I
have something to do on this date from access form...
is this possible to do and how do you do it?
Yes it is possible. You control Outlook through COM (formerly OLE)
Automation. You need to set a reference in your Project to Outlook. Here is
a sample code snippet to set an appointment reminder:
Public Sub addAppointment(strID As String, strName As String, strPhone As
String, strContact As String, Optional varMinutes As Variant, Optional
strMessage As Variant)
On Error GoTo Error_addAppointment
Dim objOutlook As Object
Dim objAppointment As AppointmentItem
Dim boolLaunched As Boolean
On Error Resume Next
Set objOutlook = GetObject(Class:="Outlook.Application")
If err.Number Then
Set objOutlook = CreateObject("Outlook.Application")
boolLaunched = True
End If
On Error GoTo Error_addAppointment
If IsMissing(varMinutes) Then
varMinutes = 0
End If
If Not objOutlook Is Nothing Then
Set objAppointment = objOutlook.CreateItem(olAppointmentItem)
With objAppointment
.Subject = "Cust " & strID & " - " & strName & ", " &
Format(strPhone, "(###) ###-####") & " " & strContact
.Duration = 5
.ReminderMinutesBeforeStart = varMinutes
.ReminderSet = True
'.Start = DateAdd("n", inttime + 5, Now())
'inttime = inttime + 5
If Not IsMissing(strMessage) Then
.Body = strmessage
End If
.Display True ' Display modal form
End With
End If
Set objAppointment = Nothing
Set objOutlook = Nothing
Exit_addAppointment:
Exit Sub
Error_addAppointment:
msgbox error, vbCritical, "Error " & err & " - addAppointment"
Resume Exit_addAppointment
End Sub