ACC: How to Run Schedule+ from MS Access Using Automation

Last reviewed: September 3, 1997
Article ID: Q147633
The information in this article applies to:
  • Microsoft Access versions 7.0, 97

SUMMARY

Advanced: Requires expert coding, interoperability, and multiuser skills.

This article demonstrates how to run Schedule+ to display a schedule for the current user from Microsoft Access using Automation.

This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.

MORE INFORMATION

The following example describes how to create a form that has a command button on it for running Schedule+ and displaying a schedule for the current user.

To run Schedule+ from a Microsoft Access form, follow these steps:

  1. Create a new form not based on any table or query in Design View.

  2. Add a command button to the form as follows:

          Command button:
          Name: RunSchedulePlus
          Caption: Start Schedule+
          OnClick: =StartSchedPlus()
    

  3. On the View menu, click Code to open the form module.

  4. In the General section of the module, add the following function:

       '--------------------------------------------------------------------
       ' This function sets an object variable to the Schedule+ Application
       ' object using the CreateObject() function. Then, it checks
       ' the LoggedOn data member to determine if the current user is
       ' logged-on. If not, it displays an InputBox for entering a user
       ' profile and then logs-on to Schedule+. Once logged on, the procedure
       ' uses the ScheduleLogged data member to return a schedule for the
       ' current user.
       '--------------------------------------------------------------------
    
          Public Function StartSchedPlus()
          On Error GoTo StartSchedPlus_Error
    
             Dim spObj As Object, spSchedule As Object
             Dim UserName As String
    
             ' Create a Schedule+ object.
             Set spObj = CreateObject("SchedulePlus.Application")
    
                ' Determine if user is logged on to Schedule+.
                If Not spObj.LoggedOn Then
                  UserName = InputBox("Please enter your profile name." & _
                             Chr(13) & Chr(13) & "Example: Nancy Davolio")
                  spObj.Logon UserName, " ", True
                End If
    
             Set spSchedule = spObj.ScheduleLogged
             spSchedule.Activate
    
             Exit Function
    
          StartSchedPlus_Error:
             MsgBox "Error: " & Err & " " & Error
             Exit Function
          End Function
    
    

  5. Close the Form module and switch the form to Form view.

  6. Click the Start Schedule+ button to open Schedule+ and display a schedule for the current user.

REFERENCES

For information about running Microsoft Outlook from Microsoft Access, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q161012
   TITLE:      VBA: How to Create a New Contact Item in Outlook with 
               Automation

For more information about Automation, search the Help Index for "Automation," or ask the Microsoft Access 97 Office Assistant.
Keywords          : AutoGnrl kbinterop IntpOleA
Technology        : kbole
Version           : 7.0 97
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 3, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.