Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Apr 2005
    Location
    Plovdiv
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open database (Access 2000)

    Is there any method of opening a database from a current database,by clicking on a control?
    I mean while being in one database to close it, and open another one? Is there any method to use the DAO.6 library,becasue i use it already?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Open database (Access 2000)

    This is very unusual - why would you want to do that in code? If the user wants to open another database, he/she can click the Open button on the toolbar.

  3. #3
    2 Star Lounger
    Join Date
    Apr 2005
    Location
    Plovdiv
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open database (Access 2000)

    I wanted to save the time when we are testing 2 databases when going to and fro one database to another.In this way we might with on click
    find ourselves in the otherdatabase,see the results and then go back again.This is the reason of my question.

    regards

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Open database (Access 2000)

    Here is some code I used to do that job

    this runs another copy of Access, opens a specified db, then closes the current db

    Dim strFilename as string
    Dim RetVal
    strfilename = "pathtoNewDatabase"
    RetVal = Shell("C:Program FilesMicrosoft OfficeOfficeMSACCESS.EXE " & strfilename, 1)
    DoCmd.Quit


    My reason for doing this was that I wanted to launch a db whose sole job was to do a backup of the original one, and email a zipped copy of the backup off to a central server.
    Regards
    John



  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Open database (Access 2000)

    John Hutchison has posted some code you can use.

    You might just as easily use the list of recently opened databases in the File menu. If you're switching back and forth, the previously opened database will be at the top of the list.

  6. #6
    2 Star Lounger
    Join Date
    Apr 2005
    Location
    Plovdiv
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open database (Access 2000)

    Thank you very much indeed !

Posting Permissions

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