p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access (http://p2p.wrox.com/forumdisplay.php?f=18)
-   -   Opening One Database from another (http://p2p.wrox.com/showthread.php?t=32999)

Brendan Bartley August 30th, 2005 11:06 AM

Opening One Database from another
 
Hi All Again
Is it possible to open one database from another database without using a hyperlink
Thanks
Brendan


aware August 30th, 2005 11:20 AM

Not sure if I can help, but could you not link to the other database, that way you can treat the other databases tables as if they were local.


Andy G

mmcdonal August 30th, 2005 02:33 PM

Do you just want to open it to have it come open on the main form? Or do you want to access its data (tables, queries)? Or do you want to run a report?


mmcdonal

Brendan Bartley August 31st, 2005 03:18 AM

I want to have a link from the main database to another smaller database this cannot be in the form of a hyperlink. The link will open the smaller database that is all it will do.


dartcoach August 31st, 2005 03:23 AM

As mmcdonal asked, when you link to this other database, do you want to pass control to it and open a form or what?

Kevin

dartcoach

Brendan Bartley August 31st, 2005 03:47 AM

Yes control will be transferred to the second database


dartcoach August 31st, 2005 04:06 AM

Brendan,
This will open the other database on top of the one you open it from:

Create a button on one of your forms and in the on click event put this:

Myfile = "C:\Kevins Stuff\Juice.mdb"
retval = Shell("msAccess.exe " & """" & Myfile & """")

It doesn't close the one you open it from, I haven't got that far yet.

Kevin

dartcoach

Brendan Bartley August 31st, 2005 04:46 AM

Kevin this does not seem to work what do you declare on you're code
Thanks
Brendan


dartcoach August 31st, 2005 04:51 AM

Brendan,
What version of access are you using? The code I gave you is all there is.
I have two databases, and all I did was add a button to one of the forms on the first database, added that code I gave you, and it worked.
I didn't have to declare anything.

Kevin

dartcoach

Brendan Bartley August 31st, 2005 05:43 AM

Version 2000



All times are GMT -4. The time now is 07:41 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.