Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Opening a different database from within the current database 2

Status
Not open for further replies.

Arnold

Programmer
Jul 2, 1999
32
NL
While in my access database, I want to click on a button that opens another access database. I want the other database to open like it would if I double clicked on it in Windows Explorer. What code do I need to put behind the button?
 
What I've always done is add a command button to a form. Then, using the wizard that comes up, select "Application" then "Run Application" then use the browse button to find the database. Save the form and open it. Then click the button.<br>
<br>
HTH,<br>
<br>
MapMan
 
I tried to do it with the wizard, but it gave me the following error: "Invalid procedure call or argument" It looked to me like the wizard was looking for .exe files, not .mdb files. I have used the wizard for executable files in the past without any problems, but not for this database. Any other ideas?<br>

 
Look at the code associated with the button and look for:<br>
stAppName = "TheOtherDatabaseName" and replace it with,<br>
<br>
the path location of your MSAccess executable plus the database to open.<br>
<br>
Here's my example:<br>
<br>
stAppName = "c:\program files\microsoft office\office\msaccess C:\VB_dbclean.mdb"<br>
<br>
This will open another instance of Access but it also opens the other database too.<br>
<br>
HTH,<br>
<br>
MapMan
 
I created severals database which open several other database applications. I placed the forms for the other databases in the primary database and then linked the tables to the primary database. I then placed buttons on my primary form which opened the other database forms. This keeps all of the applications in a single Access window. I used a Quit Application button on each of the secondary forms to close that form and return to the primary form. I find that this is a clean method which creates ease of use for non- computer users and the programs run faster than opening each program singly. It also keeps the data separated in it's own program (which is nice when I do maintenance on the db tables).
 
I created several databases which open several other database applications. I placed the forms for the other databases in the primary database and then linked the tables to the primary database. I then placed buttons on my primary form which opened the other database forms. This keeps all of the applications in a single Access window. I used a Quit Application button on each of the secondary forms to close that form and return to the primary form. I find that this is a clean method which creates ease of use for non- computer users and the programs run faster than opening each program singly. It also keeps the data separated in it's own program (which is nice when I do maintenance on the db tables).
 
I created several databases which open several other database applications. I placed the forms for the other databases in the primary database and then linked the tables to the primary database. I then placed buttons on my primary form which opened the other database forms. This keeps all of the applications in a single Access window. I used a Quit Application button on each of the secondary forms to close that form and return to the primary form. I find that this is a clean method which creates ease of use for non- computer users and the programs run faster than opening each program singly. It also keeps the data separated in it's own program (which is nice when I do maintenance on the db tables).
 
I created several databases which open several other database applications. I placed the forms for the other databases in the primary database and then linked the tables to the primary database. I then placed buttons on my primary form which opened the other database forms. This keeps all of the applications in a single Access window. I used a Quit Application button on each of the secondary forms to close that form and return to the primary form. I find that this is a clean method which creates ease of use for non- computer users and the programs run faster than opening each program singly. It also keeps the data separated in it's own program (which is nice when I do maintenance on the db tables).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top