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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launching an application in VB within Access

Status
Not open for further replies.

VoodooRageII

Programmer
Aug 25, 2002
14
0
0
US
Hi,

I have an MP3 archive db that contains a list box control. I would like to put some VB in to lauch then player and play the song when the "Listbox" is double clicked. I only need to know if there is a statement that will do this. I can come up with the code to determine the location of the file but cannot figure out or find if it is possible to launch an application file within access 2000. I can open executable such as Calc.exe but I want to launch a file?

Anyhelp would be appreciated.
 
See Shell function. Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
I can open a program with the Shell function but can it be used to open the actual (in this case) mp3 file?
 
Check thread702-336241, you may find it helpful.

Dan
 
This is for acrobat reader, but it should answer your question.

RetVal = Shell("""D:\PROGRAM FILES\Acrobat3\Reader\AcroRd32.exe""" & _
" ""D:\Program Files\Acrobat3\Reader\acrobat.pdf""", 1)

Most 32-bit apps want to see double-quotes around any filename with
embedded spaces. To use a variable, try:

RetVal = Shell("""D:\PROGRAM FILES\Acrobat3\Reader\AcroRd32.exe""" & _
" """ & SelectedFile & """", 1)

Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Thanks for the help everyone. Works like a charm!

Here is the final code
Private Sub List4_DblClick(Cancel As Integer)
Dim song As Variant
Dim volume As Variant
Dim row As Variant
row = Me!List4
song = Me!List4.Column(0, row)
volume = Me!List4.Column(1, row)
MyHyperLink.HyperlinkAddress = "C:\MP3\" & volume & "\" & Combo2 & " - " & song & ".mp3"
MyHyperLink.Hyperlink.Follow
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top