locked
Access 15.0 vs 16.0 object library- keeps going missing RRS feed

  • Question

  • So I'll preface with this- I know just enough about Access to get in trouble. I am using Access 2013, but have some folks with access to the database that is causing problems that use 2016. Most days the "Microsoft Outlook 16.0 object library" becomes "missing" and throws out error codes. When I go to fix the reference, I can only select 15.0; I do not have 16.0 in my available reference list. Selecting 15.0 will work as a band-aid, but I'll get the error/missing reference again in just a day or two. I'm looking for a permanent fix. 

    I believe that the problem lies somewhere in the code attached below; this was copied off the internet and I modified it for my use (which it works! This is the On Click event for a button -it adds an event to the outlook calendar!). I'm not sure if there is a way to modify this that it will work for both versions of Access, assuming that is my problem to begin with. 

    Thanks for whatever advice you can offer! 

    Private Sub AddAppt_Click()
    On Error GoTo AddAppt_Err
    ' Save record first to be sure required fields are filled.
    DoCmd.RunCommand acCmdSaveRecord
    ' Add a new appointment.
    Dim outobj As Outlook.Application
    Dim outappt As Outlook.AppointmentItem
    Set outobj = CreateObject("outlook.application")
    Set outappt = outobj.CreateItem(olAppointmentItem)
    With outappt
    .Start = Me!ApptDate & " " & Me!ApptTime
    .Duration = Me!leaveLength
    .Subject = Me!Apptdata
    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
    ' 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!"
    Exit Sub
    AddAppt_Err:
    MsgBox "Error " & Err.Number & vbCrLf & Err.Description
    Exit Sub
    End Sub

    Thursday, July 11, 2019 12:58 PM

All replies

  • Hi SarahPF,

    Welcome to MSDN forum.

    Based on your description, the issue seems to be development with VB6 or earlier, since our forum is about usage tools in VS IDE, we recommend you could redirect to VBForums: Visual Basic 6 and Earlier for better support.

    Thank you for your understanding.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, July 12, 2019 5:19 AM
  • Thanks! 

    Friday, July 12, 2019 12:31 PM