×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Launch Applications from Access

Launch Applications from Access

Launch Applications from Access

(OP)
Hello All,

I would like to launch various applications from a form in my database.

My idea is to have a table containing program names and their file paths / shortcuts.

Is there some VBA code that will launch a program from Access?

I have tried the code below:

CODE -->

Application.FollowHyperlink "C:\Apps\Front_End\DIARY.accdb" 

This works, but gives a security warning message each time.

Is there a better solution?

Many thanks Mark

RE: Launch Applications from Access

(OP)
OK - so I have now tried this and it works! Are there any other tips or suggestions I should be aware of?

Many thanks Mark

CODE -->

shell "msACCESS.EXE C:\Apps\Front_End\DIARY.accdb", vbNormalFocus 

RE: Launch Applications from Access

(OP)
One problem I have is it will open multiple copies of the access program. Do I need to check to see if it is already open - if so how?

Thanks Mark

RE: Launch Applications from Access

If you want to "launch various applications" - this is what I use:

CODE

Public Sub OpenDocument(strDocPath As String)
Dim G As Long
G = Shell("RUNDLL32.EXE URL.DLL,FileProtocolHandler " & strDocPath, vbNormalFocus)
End Sub 

Just pass a valid path to the file and you can open it with the application that the file is associated with. It is like double-clicking on the file in Windows Explorer


---- Andy

There is a great need for a sarcasm font.

RE: Launch Applications from Access

(OP)
Thanks, that works well.

I notice that if I am opening an Access database, if the database is not currently open, then it will open it and set focus to it (so the new database is the active window).

If however the database has already been opened, then the focus does not change to the database you are trying to open (as it would from a normal desktop shortcut). Is there a way to get the focus to always go to the program that the user is trying to open?

Many thanks Mark

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close