Open another instance of Access

M

Martin

Hi,

I'm running Access 2000 and SQL server backend. I want to
be able to open a Works Order database from the Sales
Order database and maybe passthrough the Sales Order
Number.

How do I open another database in a new instance of Access?

Is it possible to transfer a variable (i.e. Sales Order
number) between the databases?

Martin
 
M

Martin

Hi Juan,

I've tried your code and it works well thank you, the
only problem being that when the code reaches the end of
the sub it closes the database. I have removed everything
from app.closecurrentdatabase line.

Is it possible using this technique to close the existing
database and keep the new database open.

Martin
 
J

Juan M. Afan de Ribera

Hi Martin,

if you only want to close current database and open a new one, you better
use Shell. Here is an example. Usage:

CloseOpenDb "c:\Mydb.mdb"

Sub CloseOpenDb(DBName As String)
Dim AccessPath As String

AccessPath = SysCmd(acSysCmdAccessDir) & "msaccess.exe "
DBName = Chr(34) & DBName & Chr(34)

Shell AccessPath & DBName, vbNormalFocus

Quit

End Sub

HTH

--
Saludos desde Barcelona
Juan M. Afan de Ribera
<MVP Ms Access>


"Martin" <[email protected]> escribió en el mensaje
Hi Juan,

I've tried your code and it works well thank you, the
only problem being that when the code reaches the end of
the sub it closes the database. I have removed everything
from app.closecurrentdatabase line.

Is it possible using this technique to close the existing
database and keep the new database open.

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top