dobermannnn
asked on
vba code to close an access database
Hi All,
Is it possible to write a piece of vba code to CLOSE an access 97 database from within ANOTHER access 97 database? If so, how?
Thanks in advance,
Nev.
Is it possible to write a piece of vba code to CLOSE an access 97 database from within ANOTHER access 97 database? If so, how?
Thanks in advance,
Nev.
"Try
DoCmd.Quit "
Yatin, he wants to close 1.mdb from 2.mdb
I'm sure jadedata knows some uber secret KEYS that will do this.
DoCmd.Quit "
Yatin, he wants to close 1.mdb from 2.mdb
I'm sure jadedata knows some uber secret KEYS that will do this.
try
Dim oDB As Database
Set oDB = Workspaces(0).OpenDatabase ("c:\datab ases\1.mdb ")
oDB.Quit
Dave!
Dim oDB As Database
Set oDB = Workspaces(0).OpenDatabase
oDB.Quit
Dave!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi dialdnet,
I have tried this but it closes 2.mdb.
i changed the module to code firstly to
Dim db As database
Set db = currentdb
db.Close
which, when called from a button click did nothing
and then
Dim db As database
Set db = OpenDatabase("d:\tempdbs\d b1.mdb")
db.Close
the path specified being to the open db but this also did nothing. Any idea how to specify the db i want to close.
Many thanks (also to the others who have suggested things)
Nev.
I have tried this but it closes 2.mdb.
i changed the module to code firstly to
Dim db As database
Set db = currentdb
db.Close
which, when called from a button click did nothing
and then
Dim db As database
Set db = OpenDatabase("d:\tempdbs\d
db.Close
the path specified being to the open db but this also did nothing. Any idea how to specify the db i want to close.
Many thanks (also to the others who have suggested things)
Nev.
DoCmd.Quit
if you want to close the database.