Open different database file within Access using code 
Author Message
 Open different database file within Access using code


Goto http://www.*-*-*.com/ #8 and see it MichKa's free TSI SOON
add-in will do what you want.

Bruce M. Thompson, Microsoft Access MVP

>>No Email, Please. Keep all communications

    within the newsgroups so that all might benefit.<<

> Geoff

> Thanks for your suggestion.

> Sorry if my previous message didn't make this clear - but I actually want to
> open the new database within Access, as if the user had selected the
> 'File/Open..' menu option, ie new database replaces current database and
> startup form loads.

> I tried the following code:

>     Dim objWS As DAO.Workspace
>     Dim objDB As DAO.Database

>     Set objWS = DBEngine(0)
>     Set objDB = objWS.OpenDatabase("otherdb.mdb")

> However this doesn't actually load the database into the Access window. It
> does give you a reference to the mdb database, which you could use to open
> recordsets and work with data in the database - is this what you thought I
> wanted to do?

> If you have any further ideas, please let me know.

> Thanks again

> Daniel

Mon, 21 Mar 2005 21:41:10 GMT  
 [ 1 post ] 

 Relevant Pages 

1. How to open another database from within Access using code

2. Cannot open a table from a Access database file using VB5

3. Opening a db within Access VB code

4. How to Open a different Database File Whithin another

5. Print/View Access Report from within VB (with database open)

6. Open excel spreadsheet from within Access using VBA

7. Executing Excel-VBA code within a Access-database

8. opening another .mdb file within access

9. Can I open a specific Excel file from within Access

10. Open Access File from within Word

11. Open Database From Within Database


Powered by phpBB® Forum Software