Results 1 to 2 of 2
  1. #1
    LadyLyke is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    14

    Appointment form not linking to Outlook 2010

    I am trying to add onto my current database a scheduling portion that will allow users to add appointments and then those appointments get pushed to the Outlook calendar. We have over 60 clients who we schedule appt's for but there are 3 people in the office who may need to schedule an appt or who may be asked about a resident's scheduling. We also use a cloud service here so that when the database is updated on the cloud we all get the updates. I would like the scheduling feature to not only allow all users to add appt's but for the appt's to be on everyone's Outlook calendar.



    Also can the calendar have a link to each specific client?

    After following the steps in this article <http://support.microsoft.com/kb/209963> I was able to create an appointment form, only instead of Msoutl9.olb I used the msoutl.olb 14. Everything looks fine but when I click on add to outlook I get an error message saying the appointment has already been added but when I check outlook the appt is not there. If this helps here is what I have listed:

    Private Sub cmdAddAppt_Click()
    On Error GoTo Add_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 is already added to Microsoft Outlook"
    Exit Sub
    'Add a new appointment.
    Else
    Dim objOutlook As Outlook.Application
    Dim objAppt As Outlook.AppointmentItem
    Dim objRecurPattern As Outlook.RecurrencePattern


    Set objOutlook = CreateObject("Outlook.Application")
    Set objAppt = objOutlook.CreateItem(olAppointmentItem)


    With objAppt
    .Start = Me!ApptDate & " " & Me!ApptTime
    .Duration = Me!ApptLength
    .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


    Set objRecurPattern = .GetRecurrencePattern

    With objRecurPattern
    .RecurrenceType = olRecursWeekly
    .Interval = 1
    'Once per week
    .PatternStartDate = #7/9/2001#
    'You could get these values
    'from new text boxes on the form.
    .PatternEndDate = #7/23/2500#
    End With


    .Save
    .Close (olSave)
    End With
    'Release the AppointmentItem object variable.
    Set objAppt = Nothing
    End If


    'Release the Outlook object variable.
    Set objOutlook = Nothing


    'Set the AddedToOutlook flag, save the record, display a message.
    Me!AddedtoOutlook = True
    DoCmd.RunCommand acCmdSaveRecord
    MsgBox "Appointment Added!"


    Exit Sub


    Add_Err:
    MsgBox "Error " & Err.Number & vbCrLf & Err.Description
    Exit Sub
    End Sub

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    I tested your code (with minor changes to use literal data instead of references to form controls). It worked perfectly. However, I had to test with Office 2007.

    You need to step debug. Follow code as it executes. See where it deviates from expected behavior. Data getting captured from the form controls? Refer to link at bottom of my post for guidance on debug techniques.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. issue with linking outlook folder to access
    By live2ride in forum Import/Export Data
    Replies: 7
    Last Post: 12-20-2012, 12:24 PM
  2. Linking to Outlook 2010
    By crowegreg in forum Import/Export Data
    Replies: 3
    Last Post: 04-15-2012, 10:09 AM
  3. Replies: 1
    Last Post: 01-05-2012, 02:34 PM
  4. Linking Access and Outlook
    By SamanthaSteClaire in forum Access
    Replies: 1
    Last Post: 07-19-2011, 02:32 PM
  5. MS Access / MS Outlook Linking
    By foxtrot in forum Access
    Replies: 1
    Last Post: 11-30-2010, 10:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums