Opening Access Only Question

L

Launchnet

Hi . . .
I currently use the following code to open a new instance of Access on my PC.
It works fine.

What I need is to have the code open Access from any location that the .EXE
file may be located at. Some of my users have it with different paths.

Sub NewAccessOnly()
Shell "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE",
vbNormalFocus
End Sub

Can someone give me a hand please?

Thanks
Matt@Launchnet
 
N

Norman Yuan

If you use ActiveX automation to launch MS Access, instead of SHell(), then
it does not matter where msaccess.exe is located. Better yet, with
automation, you can use your code to let Access do many things a user can do
manually. While using Shell, after Access started, your code have little
control to the Access it started.

Dim asc as Access.Application
Set asc=New Access.Application
asc.Visible=True
....
'Do something with Access
....
'If you are done, yo can choose to close it programmatically
asc.Quit
 

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