none
Open second database from within first database RRS feed

  • Question

  • I'm using the following code to open one Access database from another:

         OpenDb strCalendarLocation

    strCalendarLocation is the full path and file name of the second database.

    The code works fine.  When the second database is available, the Access icon in the taskbar blinks.  I click it and the second database appears.

    Question:  Is there any way my code could fully open the second database without me having to click on the blinking icon?

    Thanks!

    Ken

    Wednesday, July 10, 2019 3:25 AM

Answers

  • Try the following code.  

    Private Sub myNextDB()
    Dim accapp As Access.Application
    Set accapp = New Access.Application
     
    accapp.OpenCurrentDatabase ("C:\myAppFolder\TestApp.accdb")
    
    End Sub


    If this post answered or helped you find the answer to your question, please mark it as such for other Forum users knowledge.

    • Marked as answer by Ken Ravazzolo Wednesday, July 10, 2019 4:11 PM
    Wednesday, July 10, 2019 3:31 PM

All replies

  • What is the code of OpenDb? It is not a built-in instruction.

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Wednesday, July 10, 2019 7:44 AM
  • Try the following code.  

    Private Sub myNextDB()
    Dim accapp As Access.Application
    Set accapp = New Access.Application
     
    accapp.OpenCurrentDatabase ("C:\myAppFolder\TestApp.accdb")
    
    End Sub


    If this post answered or helped you find the answer to your question, please mark it as such for other Forum users knowledge.

    • Marked as answer by Ken Ravazzolo Wednesday, July 10, 2019 4:11 PM
    Wednesday, July 10, 2019 3:31 PM
  • Hans,

    Great hearing from you! 

    Your code works perfectly.  I simply added "accapp.Visible = True", and it popped-up automatically.

    Thanks again!

    Ken

    Wednesday, July 10, 2019 4:16 PM
  • The code was from DriveEV!

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Wednesday, July 10, 2019 6:04 PM