Results 1 to 3 of 3
  1. #1
    avarusbrightfyre is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Sep 2009
    Posts
    60

    How do I open another database using VBA?

    Ok, so this relates to some access updating questions I've been asking. I went to that AutoFEUpdater site and read through it, and it all seemed a bit complicated and required too much user interaction. I'm dealing with non-pc literate people here and I'd like to make the whole thing program driven.

    I saw an alternate solution on the website that involves opening a separate updating database, using that database to automatically replace the old file with the new file, then reopening the database. The updater program works fine, but I'm having a hell of a time trying to figure out how to get the program to open using a command button.



    I've been doing research and it seems that the "shell" command is supposed to be used, but none of the places I've looked show how to actually use it. They only talk about the problems they have. What is the syntax for using the shell command? Am I supposed to have a specific reference set up in my VBA?

    I'm so close, just can't open the damned updater.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Shell is used to open any executable. type SHELL in the help menu in the VBE and it'll show you the syntax.

    Also, have you checked out the application.openCurrentDatabase option? From what I understand, that is the way to get more than one database open at a time. That also changes the currentDb() to the newly opened file, so all of the code executed after the open command may apply to that db instead of your old one. Not really sure though. Personally I would guess not, until the current running procedure is ended at least.

  3. #3
    avarusbrightfyre is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Sep 2009
    Posts
    60
    I tried both the application.opencurrentdatabase and the application.openaccessproject and they both tell me that the database I'm trying to open is already running.....which isn't the case.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. P/W Protect & Open Database Using VBA
    By DrGlenn in forum Programming
    Replies: 1
    Last Post: 08-06-2010, 08:08 PM
  2. Impossible to open more database
    By Grooz13 in forum Access
    Replies: 54
    Last Post: 08-06-2010, 05:17 PM
  3. open a secure database
    By ngeng4 in forum Security
    Replies: 5
    Last Post: 08-01-2010, 10:57 PM
  4. cannot open any database
    By Factor in forum Access
    Replies: 3
    Last Post: 03-24-2010, 12:51 PM
  5. Have database open automatically
    By Norman Masson in forum Access
    Replies: 6
    Last Post: 01-08-2008, 07:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums