Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    automation delay (2003)

    I am scheduling appointments in outlook through automation code from access . There is often a considerable delay between when the appointment is scheduled and when it appears on the outlook calendar. Any ideas and can it be improved.

    Nebbia

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: automation delay (2003)

    Is this in stand-alone Outlook or on Exchange? In Exchange, it may some time for the Exchange server to synchronize the calendar.

  3. #3
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: automation delay (2003)

    This is a stand alone installation

    nebbia

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: automation delay (2003)

    In that case, the appointment should appear in the calendar the moment it is created.
    I don't know if we can improve it, but we'd have to see the code you are using.

  5. #5
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: automation delay (2003)

    this is the code for the scheduler


    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

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

    With objAppt
    .Start = Me!ApptDate & " " & Me!ApptTime
    .Duration = Me!ApptLength
    .Subject = Me!First & " " & Me!LastName


    If Not IsNull(Me!ApptLocation) Then .Location = Me!ApptLocation & " ID# " & Me.PatientID
    If Me!ApptReminder Then
    .ReminderMinutesBeforeStart = Me!ReminderMinutes
    .ReminderSet = True
    End If



    .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

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: automation delay (2003)

    The appointment should appear as soon as the .Save instruction is executed.

    If Outlook is not running, the line Set objOutlook = CreateObject("Outlook.Application") will take some time to execute - could that be the cause of the delay?

  7. #7
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: automation delay (2003)

    needless to say I can't tellhow fast the entry is placed with Outlook closed. With outlook open both to the date of the appointment orto a different date the delay is the same

    nebbia

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: automation delay (2003)

    I'm afraid I can't explain the delay. I just now tried your code, modifying it only in so far as needed to make it run in my test database. The appointment appeared instantly (with Outlook already running).

    If you wish, you can post a stripped down copy of your database. See <post#=401925>post 401925</post#> for instructions. But I cannot guarantee that it'll be possible to find the cause of the delay.

  9. #9
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: automation delay (2003)

    Thanks for the help.I'll tinker with it for a while to see if I can find the hangup. Thanks for the help

  10. #10
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: automation delay (2003)

    A new issue has developed. The code seemed to work properly. Now I am getting an error #92- invalid use of null. I can't figure out what has changed. The backend is on a network

    nebbia

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: automation delay (2003)

    Temporarily comment out the line

    On Error GoTo Add_Err

    by inserting an apostrophe in front of it. When the error message is displayed, click Debug. Which line is highlighted?

  12. #12
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: automation delay (2003)

    At .Body = Me.ApptNotes I've since discovered that if this control is not left blank that I don't get an error message

    nebbia

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: automation delay (2003)

    You could build in a check. Either exit the procedure with a warning to the user if AppNotes is null, or skip the line

    .Body = Me.ApptNotes

    if AppNotes is null.

  14. #14
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: automation delay (2003)

    I can try that. Why is it that with the table field set to accept 'zero lengths' that this sort of error is generated? Does it matter is this is a text or memo field?

    nebbia

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: automation delay (2003)

    Even if the AppNotes field is set to accept zero length strings, its value will still be null if the user never entered anything in it. Since the Body property of the appointment is of type String, it can't be set to Null.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •