Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Focus from one db to another

Status
Not open for further replies.

zoroaster

Programmer
Jun 10, 2003
131
GB
I'm using Acc2002. What I'm trying to acheive is the following:
1st database (Db1) does some processing
Db1 then opens 2nd database (Db2), which will start processing
Db1 closes itself down.
Db2 completes processing.

How I was hoping to acheive this was using this code:
Code:
Dim strPath As String
Dim dUntil As Date
strPath = "C:\File Converter\Program\DLOAD.mdb"
Set acApp = CreateObject("Access.Application")
acApp.Visible = True
acApp.OpenCurrentDatabase (strPath)

DoCmd.Quit acQuitSaveAll
...having the Db2's AUTOEXEC kick off on open before Db1's 'DoCmd.Quit' executes. But it won't have it. The autoexec doesn't kick in, and the Quit closes BOTH databases. Can I actually do what I'm trying to, or am I wasting my time.

I know this all begs the question "Why the hell do you want to do this anyway"? - it all goes back to Thread 1108345



Laters, Z

"42??? We're going to get lynched!
 
We use the following (Access97) to start another db and close/quit the first db. The second db compacts the first after the first is closed. You need to use a shell command, that will allow "focus" to pass from one db to another (at least with what little I know).

Dim stAppName As String
stAppName = "MSAccess.exe ""C:\SpecialTax\SpecTaxCompact.mdb"" "
Call Shell(stAppName, 1)
Docmd.Quit

 
Thanks Bubba100, that seems to work just fine now!

Laters, Z

"42??? We're going to get lynched!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top