Results 1 to 2 of 2

Thread: Windows Media Player in MS Access

  1. #1

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,602

    Windows Media Player in MS Access

    Hi all.
    I put a WMP ActiveX control on my form in Access, and I've had a tough time hunting down properties, events, etc. as they are different from when using in VB and even different from Excel.
    I finally got my files to play, but when I want to play several files in a row, there is no waiting, it goes right to the last one.

    I need one of two approaches:
    1. build a playlist dynamically and have it play.
    2. find the state of the WMP and have a DoEvents Loop through the files to play, waiting for the state of the WMP to change each time.
    I can't find these properties in the WMP control in Access.
    Some events and properties do exist, but do not autofill like with most controls, so it's a guessing game with too many possibilities to guess it out.

    Any help is appreciated (not looking for a timer-based solution or out of the box idea, just where I can find these properties on the WMP control).
    Thanks.
    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

  2. #2

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,602

    Re: Windows Media Player in MS Access

    Hi all.
    Update: I couldn't find enough about the playlist idea to get it working, but I finally realized there was a play state change event, so I was eventually able to put the status change check in a loop and get the files to play one after the other. Looks like this:

    Dim tPlayerState as Integer
    Private Sub Playfile(Filepath)
    Me.WMP1.URL = Filepath
    Me.WMP1.Object.Controls.play
    End Sub

    Private Sub WMP1_PlayStateChange(ByVal NewState As Long)
    tPlayerState = NewState
    End Sub

    Sub xxxx
    .......
    For c = 1 To 5
    Playfile AppPath & "\" & File(c) & ".mp3"
    Do
    DoEvents
    Loop Until tPlayerState = 1
    Next 'c
    ....
    End Sub


    So, it's working now, but some unpredictable problems started happening when I added sound to the form.
    It's a problem for a different post.
    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

Posting Permissions

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



Click Here to Expand Forum to Full Width