Opening a Database from within a Database 
Author Message
 Opening a Database from within a Database

Can anyone help me?

The problem I am having is I need to be in a database, have the user select
another database using an ActiveX explorer control, then using code, close
the current database and open the selected one without opening another
instance of Access.

Please E-mail and post the response.




Sat, 16 Dec 2000 03:00:00 GMT  
 Opening a Database from within a Database

Hi Vito,

AFAIK., to open a database within the same instance of Access, you need to
use Sendkeys, something we don't advice normally.

The syntax would be
SendKeys "%FO" & strInMDB & "~"

where strInMDB is the path to the mdb you've selected.

But unless you're bound to using the same instance, I'd suggest using
Automation (CreateObject) to spawn another instance of Access and then use
OpenCurrentDatabase on this new instance.

HTH
--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://home.att.net/~dashish )
---------------

:Can anyone help me?
:
:The problem I am having is I need to be in a database, have the user select
:another database using an ActiveX explorer control, then using code, close
:the current database and open the selected one without opening another
:instance of Access.
:
:Please E-mail and post the response.
:

:
:



Sat, 16 Dec 2000 03:00:00 GMT  
 Opening a Database from within a Database

Would this work for you:
Shell("MSACCESS.EXE " & YourDataBase);
Docmd.Quit

It starts a new instance and closes the current one. There's a gotcha: you
must know the access program path.

Vito a crit dans le message ...

Quote:
>Can anyone help me?

>The problem I am having is I need to be in a database, have the user select
>another database using an ActiveX explorer control, then using code, close
>the current database and open the selected one without opening another
>instance of Access.

>Please E-mail and post the response.





Sun, 17 Dec 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Open Database From Within Database

2. How to Open database from within another database

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

4. Open different database file within Access using code

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

6. Cannot open database because the database is in an unexpected state

7. Close Database Then Open Database

8. Close Database Then Open Database

9. Open another database from a database?

10. Multi database SQL OLE DB can't open database (20599)

11. Error opening database Unrecognized database format

12. create database, open database

 

 
Powered by phpBB® Forum Software