jonamua1971
Registered User.
- Local time
- Today, 07:54
- Joined
- Mar 3, 2007
- Messages
- 97
Hi
i have searched this forum and received some help from Bob but am still getting the same error on my database.
i have one of the form that send appointment to Outlook calendar. the appointments will show just fine when the database is not split but when i split the database, i get Compile Error/ User type not Defined.
i tried to change the code as Bob advised me but i kept getting the same error.
Below is the code i have used on the form.
Any help will be highly appreciated.[Private Sub cmdAddAppt_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 objAppt As Object
Dim outappt As Outlook.AppointmentItem
Set outobj = GetObject("", "outlook.application")
Set outappt = outobj.CreateItem(olAppointmentItem)
With outappt
.Start = Me!ApptDate & " " & Me!ApptTime
.Subject = Me!Appt
If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes
If Not IsNull(Me!ApptLocation) Then .Location = _
Me!ApptLocation
If Me!ApptReminder Then
.ReminderMinutesBeforeStart = Me!ReminderMinutes
.ReminderSet = True
End If
.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 "Appointment Added]
i have searched this forum and received some help from Bob but am still getting the same error on my database.
i have one of the form that send appointment to Outlook calendar. the appointments will show just fine when the database is not split but when i split the database, i get Compile Error/ User type not Defined.
i tried to change the code as Bob advised me but i kept getting the same error.
Below is the code i have used on the form.
Any help will be highly appreciated.[Private Sub cmdAddAppt_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 objAppt As Object
Dim outappt As Outlook.AppointmentItem
Set outobj = GetObject("", "outlook.application")
Set outappt = outobj.CreateItem(olAppointmentItem)
With outappt
.Start = Me!ApptDate & " " & Me!ApptTime
.Subject = Me!Appt
If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes
If Not IsNull(Me!ApptLocation) Then .Location = _
Me!ApptLocation
If Me!ApptReminder Then
.ReminderMinutesBeforeStart = Me!ReminderMinutes
.ReminderSet = True
End If
.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 "Appointment Added]