Close one Database while openning another

T

Terry

Last question was so helpful. Here is another that I have
not been able to solve and left as is for lack of
knowledge.

I have a form that is called utility. We have several
master mdb files that get used as templates for several
jobs. The utility copies the requested template(mdb file)
to a given job directory to a new provided name (name and
path are requested on the form in utitlity.mdb). The
problem is the person has to close the utility.mdb and
then locate the job directory and open the new mdb file.

Is there a procedure that would close the utility.mdb and
open the new mdb using the path and file name provided on
form in the utility.mdb?

Thanks...
 
T

Terry

Thought I tried this a few years ago. Maybe 2002 works
better than older versions as this time it worked with the
quit. I think in 95 you could not quit while in the vb
code if you openned another database...
Is this the proper way however???????
Dim MyAppID, ReturnValue
'open the new file
'MyAppID = Shell("C:\Program Files\Microsoft
Office\Office10\msaccess.exe Y:\Jobs\2005Jobs\205017
\NCmodel\NC-test3.mdb", 1)
Docmd.Quit
 
A

Andi Mayer..

Last question was so helpful. Here is another that I have
not been able to solve and left as is for lack of
knowledge.

I have a form that is called utility. We have several
master mdb files that get used as templates for several
jobs. The utility copies the requested template(mdb file)
to a given job directory to a new provided name (name and
path are requested on the form in utitlity.mdb). The
problem is the person has to close the utility.mdb and
then locate the job directory and open the new mdb file.

Is there a procedure that would close the utility.mdb and
open the new mdb using the path and file name provided on
form in the utility.mdb?

Thanks...

Shell Environ("comspec") & " /c " &chr(34) &"newDbPatrhName" &chr(34)
Application.Quit
 
Top