Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179

    Unanswered: How Do I Launch An Access App?

    I've been using this technique to open an excel file, with great sucess. An instance of excel is opened, and the specified file is loaded. When the subroutine completes, the excel application remains open.
    Code:
    Sub OpenExcelApp(strPathAndFile As String)
       Dim xlApp As Object
       Set xlApp = CreateObject("Excel.Sheet")
       xlApp.Application.Visible = True
       xlApp.Application.Workbooks.Open strPathAndFile
    End Sub
    Now, I need to open an access application, and would like to use the same technique. But it doesn't work the same way! When the subroutine completes, the newly opened access application shuts down.
    Code:
    Sub OpenAccessApp(strPathAndFile As String)
       Dim oAccApp As Object
       Set oAccApp = CreateObject("Access.Application")
       oAccApp.Application.Visible = True
       oAccApp.Application.OpenCurrentDatabase strPathAndFile
    End Sub
    Does anyone know how I can launch an access app, from access?

  2. #2
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Re: How Do I Launch An Access App?

    Tried your code with the Northwind.mdb and it works fine.
    Maybe you can try this just to make sure there's nothing 'wrong' with the database you want to open.

  3. #3
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179
    Oh I get it. If I open an mdb that isn't fubar, it works. Serves me right for using an un-tested app.


    Thanks very much artemide!

Posting Permissions

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