 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 30th, 2005, 11:06 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Opening One Database from another
Hi All Again
Is it possible to open one database from another database without using a hyperlink
Thanks
Brendan
__________________
Brendan Bartley
|
|

August 30th, 2005, 11:20 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

August 30th, 2005, 02:33 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
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
|
|

August 31st, 2005, 03:18 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

August 31st, 2005, 03:23 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

August 31st, 2005, 03:47 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yes control will be transferred to the second database
|
|

August 31st, 2005, 04:06 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

August 31st, 2005, 04:46 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Kevin this does not seem to work what do you declare on you're code
Thanks
Brendan
|
|

August 31st, 2005, 04:51 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

August 31st, 2005, 05:43 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Version 2000
|
|
 |