Open another instance of Access

  • Thread starter Thread starter Martin
  • Start date Start date
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
 
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
 
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
 
Back
Top