Question Split Database=Compile Error

jonamua1971

Registered User.
Local time
Today, 11:17
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]
 
HAve you checked the references after you split the DB??
 
i have the following the references checked:

1. Microsoft DAO 3.6 Object library
2. OLE Automation
3. Microsoft Access 11.0 Object
4. Visual basic for application
thanks
 
I suspect that you need to have the Microsoft Outlook Object checked as well.

Look and see what you had checked in your unsplit working DB and make sure that the split DB has the same items ticked ticked
 
Thanks Rabbie for your response.
How do i do that?
assuming you still have an usplit copy of your DB just check the references the same way as you checked the references in your split DB.
 
Thanks Rabbie
You are a life saver!!!
i just checked the references before and after . they were not the same.
i then checked all that were unchecked in the process of splitting and it worked.
Thanks
 
Thanks Rabbie
You are a life saver!!!
i just checked the references before and after . they were not the same.
i then checked all that were unchecked in the process of splitting and it worked.
Thanks
Glad to have been of help
 

Users who are viewing this thread

Back
Top Bottom