Open External Mp3 file

ipuff

New member
Local time
Today, 07:04
Joined
Mar 1, 2007
Messages
8
Hello,
I am trying to open an mp3 file from a form. Basically, every record has a unique mp3 file. The file name is the telephone number. They are all situated in one specific folder. Can anyone please help me how to open a mp3 file with access.

thanks so much
 
It depends on which program you wish to use to play the MP3. I often use a shell command to open up adobe reader to view a pdf. You will need to know the name of the command and what flags, if any should be passed to it. Here are a couple of examples of shell commands I use in VBA:

Code:
        AppName = DLookup("[value]", "Control", "[Code]='InspImgApp' ")
        imgdir = DLookup("[value]", "Control", "[Code]='BLCImgDir' ")
        imgdir = imgdir & OrderNumber & "-00.pdf"
        If Dir(imgdir) <> "" Then
            On Error Resume Next
            Call Shell(Chr(34) & AppName & Chr(34) & " " & Chr(34) & imgdir & Chr(34), 3)
        Else
            MsgBox "The " & imgdir & " file does not exist.", 48, "File Not Found"
        End If

and this one that opens the main menu in runtime mode:

Code:
    stDirA = DLookup("[Value]", "MainControl", "[Code]='AccessExeDirectory' ")
    stDirS = DLookup("[Value]", "MainControl", "[Code]='SystemMdwDirectory' ")
    stPath = stDirA & "MSACCESS.EXE /runtime /wrkgrp " + Chr(34) + _
                stDirS & "SYSTEM.MDW" + Chr(34) + " " + Chr(34)
    Locate = CurrentDb().Name
    Locate = Left(Locate, InStr(Locate, "Client.md") - 1) & "Main.mde"
    stAppName = stPath + Locate + Chr(34) ' + " /excl"
    Call Shell(stAppName, 1)

John M Reynolds
 

Users who are viewing this thread

Back
Top Bottom