Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jul 2004
    Marietta, Georgia, USA
    Thanked 0 Times in 0 Posts

    Setting Outlook Appointments in Microsoft Access (Access 2000/Outlook 2002)

    <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35> I'm getting an error in Access when trying to schedule appointments in Outlook. My error is "Compile Error: Invalide Use of Property" and it goes to the .PatternStartDate in the VBA code. I have attached a zipped copy of my "test database." Any help would be appreciated. I'm new to VBA so if there are any other issues or an easier way to do this, I would also appreciate this feedback.
    Attached Files Attached Files

  2. #2
    Bronze Lounger
    Join Date
    Nov 2001
    Arlington, Virginia, USA
    Thanked 3 Times in 3 Posts

    Re: Setting Outlook Appointments in Microsoft Access (Access 2000/Outlook

    Your code has this line:

    <pre>.PatternStartDate #7/9/2003#</pre>

    It should read:

    <pre>.PatternStartDate = #7/9/2003#</pre>

    PatternStartDate is a property, with a data type of Date, so you need the equal sign to assign a value to property. Also, the cmdAddAppt_Click procedure has two "End Sub" statements at end of procedure. Need to delete the extra one. Once these corrections were made, was able to compile project without compile errors.

    As for other issues, when automating Outlook from Access, I usually work with Outlook mail items, not appointment items, so have no other brilliant suggestions on the approach you are using, other than if using error handler, you should have an Exit_Sub: label, where you would place the Exit Sub statement, not in the body of the procedure. I would also set all object variables to Nothing in the Exit_Sub: code before Exit Sub statement.


Posting Permissions

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