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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close External Database

Status
Not open for further replies.

DaOtH

Technical User
Jan 22, 2002
114
SE
All,

I've got the following thing which i can't seem to figure out.

I've got 2 databases. Db1 is running, and at a certain moment opens Db2. But then, code in Db2 starts to take over and i need Db1 to be closed.

in Db1 i've got the following
shell(strAppPath & " """ & strDb2File & """", 1)
DoCmd.Quit acQuitSaveAll

But obviously that only closes Db1 after any code in Db2 finishes. SO i reckon i should be able to close Db1 from code within Db2. But How ?

Any ideas ?

"In three words I can sum up everything I've learned about life: it goes on."
- Robert Frost 1874-1963
 
Put a sub in Db1 that closes it. Call that sub from code in Db2. I'm not 100% certain it will work while the code above is still running, but it's worth a shot (after a backup, of course).

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Professional Development for Clients Large and Small

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
I think, but not sure, you need to change your shell statement.
shell(strAppPath & " """ & strDb2File & """", 0)
IIRC the 1 at the end waits for the shell to finish b4 carrying on.
hth

Ben

----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top