Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Apr 2003
    Location
    Morgantown, Pennsylvania, USA
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Play an mp3 reference (2003)

    I am sitting around today with little to do, and I thought I would catalog my mp3 files into a database. The end goal is to click on a song and have the Windows media player open up and play it (actually, queue it up so that I can click on multiple files to listen to them in order). In essence, create my own juke box. I have a table with the song name and the final file folder in a table. (All files are in "C:documents and settingsusermy documentsmy music" and the subfolder field in the table.

    I am thinking that it should be relatively easy for someone with knowledge of visual basic to create a command that will open the windows media player and plug in the song selected. I am not that person with that knowledge.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Play an mp3 reference (2003)

    Create a form based on your table.
    You can use the On Dbl Click event of the text box bound to the MP3 name field, or you can place a command button next to the text box and use its On Click event.
    The code would look like this:

    Private Sub txtMP3_DblClick(Cancel As Integer)
    If Not IsNull(Me.txtMP3) Then
    Application.FollowHyperlink "C:documents and settingsusermy documentsmy music" & Me.txtMP3
    End If
    End Sub

    or

    Private Sub cmdPlay_Click()
    If Not IsNull(Me.txtMP3) Then
    Application.FollowHyperlink "C:documents and settingsusermy documentsmy music" & Me.txtMP3
    End If
    End Sub

    where txtMP3 is the name of the text box and cmdPlay is the name of the command button. Don't forget to substitute your username.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •