Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launching other applications from Access

Status
Not open for further replies.

uksub

Programmer
Jun 15, 2003
51
US
How do you launch other applications from inside of Access? I want to create an interface to my Crystal Report reports. I'd like to click on an object in Access then launch a specific report.
 
You might take a look at the following thread. It shows how to launch Acrobat from Access.

thread181-710279

Hope it helps.
 
Or, if your Access app is on different flavor OS's, and not sure where Crystal Reports (or any other associated app) is located on users PC, you could:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal Hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Public Const SW_SHOWNORMAL = 1

Sub OpenFile(ByVal Filename As String, Optional Parms As Variant)

Dim Rc As Long
Dim Msg As String

If IsMissing(Parms) Then
Parms = ""
End If
Rc = ShellExecute(0, "Open", Filename, Parms, "", SW_SHOWNORMAL)
If Rc < 32 Then
Msg = &quot;There was an error opening &quot; & Filename & &quot;. &quot; & _
&quot;Please check the filetype, and the application that should be used to open it.&quot;
MsgBox Msg, vbOKOnly + vbCritical, &quot;Error&quot;
End If

End Sub

Then, on your form:

Call OpenFile(&quot;C:\YourFile.doc&quot;)

(I'm sure I stole this from somewhere...)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top