Results 1 to 12 of 12
  1. #1
    Join Date
    Dec 2003
    Posts
    10

    Question Unanswered: calling a database

    urgent: how can I call another Access 2000 database from another database already open and then close the first one - or is there another way of setting up a master menu to open different databases.
    I want to split my database into one with all the tables linked to each of three others handling three separate subject areas : sales, purchases, and base_entities. This will allow more efficient development.

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: calling a database

    Originally posted by Dalbir Singh
    urgent: how can I call another Access 2000 database from another database already open and then close the first one - or is there another way of setting up a master menu to open different databases.
    I want to split my database into one with all the tables linked to each of three others handling three separate subject areas : sales, purchases, and base_entities. This will allow more efficient development.
    Try to use the Shell command to run the secound DB

  3. #3
    Join Date
    Dec 2003
    Posts
    10
    Tantalising ...how do I apply the SHELL command, and what are they for opening the new database and then closing the current database ...

  4. #4
    Join Date
    Nov 2003
    Location
    Warren, PA
    Posts
    52
    The Shell command indeed here it is if you need it:

    Call Shell("C:\Program Files\Microsoft Office\Office10\msaccess.exe Y:\DATABASEPATH\DBNAME.mdb",1)
    DoCmd.Quit acSave

    Brent

  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Originally posted by bhummel
    The Shell command indeed here it is if you need it:

    Call Shell("C:\Program Files\Microsoft Office\Office10\msaccess.exe Y:\DATABASEPATH\DBNAME.mdb",1)
    DoCmd.Quit acSave

    Brent
    That is right, so you can use the shell command to open your DB with Access. The DoCmd.Quit acSave will close the current DB


    Good Luck

  6. #6
    Join Date
    Dec 2003
    Posts
    10
    No go !! I get the message "Run time error 53 File not found".
    My code is:
    ...
    Option Explicit
    Function FUN_opendatabase()
    Call Shell ("C:\program files\microsoft Office\Office10\msaccess.exe _C:\msdata\dbname.mdb", 1)
    End Function

    I have also tried :
    ...
    Option Explicit
    Function FUN_opendatabase()
    Dim retVal
    retVal= Shell ("C:\program files\microsoft Office\Office10\msaccess.exe _C:\msdata\dbname.mdb", 1)
    End Function

    Next ..??

  7. #7
    Join Date
    Nov 2003
    Location
    Warren, PA
    Posts
    52
    Originally posted by Dalbir Singh
    No go !! I get the message "Run time error 53 File not found".
    My code is:
    ...
    Option Explicit
    Function FUN_opendatabase()
    Call Shell ("C:\program files\microsoft Office\Office10\msaccess.exe _C:\msdata\dbname.mdb", 1)
    End Function

    I have also tried :
    ...
    Option Explicit
    Function FUN_opendatabase()
    Dim retVal
    retVal= Shell ("C:\program files\microsoft Office\Office10\msaccess.exe C:\msdata\dbname.mdb", 1)
    End Function

    Next ..??

    What OS?
    Try This
    Call Shell ("C:\progra~1\micros~1\Office10\msaccess.exe C:\msdata\dbname.mdb", 1)
    Last edited by bhummel; 12-10-03 at 10:46.

  8. #8
    Join Date
    Dec 2003
    Posts
    10
    Abject apologies: OS is Windows 2000 professional.

    Still no go with sysntax using ~ : error code is now 76 !

    Gulp !

  9. #9
    Join Date
    Nov 2003
    Location
    Warren, PA
    Posts
    52
    Originally posted by Dalbir Singh
    Abject apologies: OS is Windows 2000 professional.

    Still no go with sysntax using ~ : error code is now 76 !

    Gulp !
    Run this and print screen the error so I can see the actual error message.

    Call Shell("C:\Program Files\Microsoft Office\Office10\msaccess.exe C:\msdata\dbname.mdb",1)
    DoCmd.Quit acSave

    Brent

  10. #10
    Join Date
    Dec 2003
    Posts
    10
    Not easy because in my paranoia the Application system PC is physically isolated form the internet and capturing a screen image to send is well beyond me...

    However, more precisely the error message is a pop-up form:

    Microsoft Visual Basic
    Run-time error '53':
    File not found

    I created 1. an Access Basic Function with the Call Shell statement and 2. a Macro in my Access2000 database set in XP Office suite with RunCode action to execute the Access Basic Function - which promptly slaps me with the error as shown.

    Oh Lord !

  11. #11
    Join Date
    Nov 2003
    Location
    Warren, PA
    Posts
    52
    If you wish this is strickly done by macro see the example.jpg attached
    Also make sure your DBname is one word

    Like
    mydatabase.mdb

    not
    my database.mdb


    Brent
    Attached Thumbnails Attached Thumbnails example.jpg  

  12. #12
    Join Date
    Dec 2003
    Posts
    10

    Talking

    It works and its elegant - I am relieved!

    Thank you.

Posting Permissions

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