Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003

    Question Unanswered: Open Access Database Form from within Access database

    I'm needing to open another Access database from within an all ready opened Access database. I don't want to close the all ready opened Access database. I just want to open another Access database and open an existing form in this database. The following is the code I currently have. And it appears that it's trying to open the database but I'm unable to view the form or do anything with it. The reason I know it's trying to open the database is because when I go look at the database file from windows explorer there is a .ldb along with the .mdb for the database I'm trying to open. And that is the file that get created when you have an access database open. But I'm unable to see it or do anything with the database. If anyone could help me out that would be greatly appreciated. Here is the VBA code that I currently have.

    Dim appAccess As Access.Application

    ' Initialize string to database path.
    Const strConPathToSamples = "C:\Documents and Settings\My Documents\CareNet Excel-Access Project\Careset Data Verification\Error Log Database.mdb"

    strDB = strConPathToSamples & "Error Log Database.mdb"
    ' Create new instance of Microsoft Access.
    Set appAccess = CreateObject("Access.Application")
    ' Open database in Microsoft Access window.
    appAccess.OpenCurrentDatabase strConPathToSamples

    ' Open form.
    appAccess.DoCmd.OpenForm "Import Error Logs", acNormal

    Thanks Bailee220

  2. #2
    Join Date
    Sep 2003

    I needed something like you tried to do. I used your code and then I added this:

    appAccess.visible = true

    Hope it helps!

  3. #3
    Join Date
    May 2004
    New York State
    Is the "Modal" property for your first database's form set to "Yes" either in the property sheet or in code? If so, you must close the form before you'll have access to your new database window.


Posting Permissions

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