Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
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
 
Old August 31st, 2005, 05:51 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Brendan,
Inside your VBA code, check out help on the shell command. There may be differenct syntax since I'm using version 2003. Also, change the code I gave you to:

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

By adding the ,1 at the end, it brings the second database completely up on top of the other.

Let me know.

Kevin

dartcoach
 
Old August 31st, 2005, 06:12 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Kevin all ok now ajusted code and working fine

 
Old August 31st, 2005, 06:16 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Brendan,
So everything is working OK? Do you want to close the other database when you open the other one? If not, when you close the second database, you will be right back where you were in the first one. Is that what you want?

Kevin

dartcoach
 
Old August 31st, 2005, 06:18 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Myfile = "C:\Documents and Settings\bartleyb\Desktop\Comms success.mdb"
retval = Shell("msAccess.exe " & """" & Myfile & """", vbMaximizedFocus)

DoCmd.Quit
Kevin I used the following code that sets focus on the opened database and closes the other database

 
Old August 31st, 2005, 06:20 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am still curious as to why two databases? If you need to go to the second one to update a record or add a new one when some activity is going on in the first database, can't you automate that? Are the databases so large that they can't be consolidated? Just curious. Glad it's working for you.



mmcdonal
 
Old August 31st, 2005, 06:20 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Brendan,
Great! Glad I could help.

Kevin

dartcoach
 
Old August 31st, 2005, 09:47 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the second database is used to send an e-mail automatically to a group when equipment goes down

 
Old August 31st, 2005, 11:41 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Brendan,
How big is this other database? Couldn't you import all the forms, queries, tables etc. into the current database and just add a button to do what you need to do? Or even link to the data you need? I really don't know what's best, not knowing what your whole process is.

Kevin

dartcoach
 
Old August 31st, 2005, 12:27 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

That's what I am thinking. At least retrieve data from the second database and automate the email from the first database.

mmcdonal
 
Old August 22nd, 2007, 04:03 AM
Registered User
 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I used the same way to open the 2nd database and close the 1st one.

My problem is to hide the startup screen when the 2nd database starts by Shell command.

strOpenClient = "MSAccess.exe " & strDest
Shell strOpenClient, vbNormalFocus
DoCmd.Quit

Advanced thanks!
Mona






Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening & Closing Database connections pauliehaha Classic ASP Databases 4 December 18th, 2006 08:50 AM
Problems opening MS Access database JayM ASP.NET 2.0 Basics 1 June 5th, 2006 01:59 PM
Database Error message when opening Brendan Bartley Access 1 July 19th, 2005 12:26 PM
Problem in opening a VSS database on remote m/c nikunjn VS.NET 2002/2003 5 July 22nd, 2004 08:57 PM
Problem with database opening bukky Classic ASP Databases 1 April 23rd, 2004 10:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.