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

August 31st, 2005, 06:12 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Kevin all ok now ajusted code and working fine
|
|

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

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

August 31st, 2005, 06:20 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
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
|
|

August 31st, 2005, 06:20 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Brendan,
Great! Glad I could help.
Kevin
dartcoach
|
|

August 31st, 2005, 09:47 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
the second database is used to send an e-mail automatically to a group when equipment goes down
|
|

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

August 31st, 2005, 12:27 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
That's what I am thinking. At least retrieve data from the second database and automate the email from the first database.
mmcdonal
|
|

August 22nd, 2007, 04:03 AM
|
|
Registered User
|
|
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|
 |