Starting an Access app from another Access app.

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Starting an Access app from another Access app.

Post by Pat »

I need to start an Access app from an Access app.
Is the shell command the way to go? or is there another preferred method?

User avatar
HansV
Administrator
Posts: 78792
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Starting an Access app from another Access app.

Post by HansV »

If you only need to open a database in another instance of Access, you can use Shell.
If you want to manipulate the database in code, you can use Automation:

Dim app As Access.Application
Set app = CreateObject("Access.Application")
app.OpenCurrentDatabase "C:\Databases\MyDatabase.mdb"
...
app.DoCmd.OpenQuery "MyQuery"
...
app.Quit
Set app = Nothing
Best wishes,
Hans

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: Starting an Access app from another Access app.

Post by Pat »

No i just have to start the access app.
Good to know the other approach though.
Thank you