WMP Activex usage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • colinod
    Contributor
    • Nov 2007
    • 347

    WMP Activex usage

    does anyone know how to stop an mp3 file playing automatically using WMP Activex in an access form.

    I have the form and the Activex getting its file from a form property but when i goto the next record it starts oplaying the file instantly, i want it not to play untill i press the play button on the WMP
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32661

    #2
    I'm not sure Colin. What type of control are you putting it in (Please provide the design details where possible)? And what, if any, code is associated with it already?

    Comment

    • colinod
      Contributor
      • Nov 2007
      • 347

      #3
      Hi

      I am using the Windows Media Player Activex control, that just looks like Windows Media Player when dragged onto the form.

      The only code associated with it is

      Code:
      Private Sub Form_Current()
      Me.WindowsMediaPlayer7.URL = Me.[File]
      ' Provide a record counter for using with
      ' custom navigation buttons (when not using
      ' Access built in navigation)
      
          Set rst = Me.RecordsetClone
      
          With rst
              .MoveFirst
              .MoveLast
              lngCount = .RecordCount
          End With
          
      'Show the result of the record count in the text box (txtRecordNo)
      
          Me.txtRecordNo = "Record " & Me.CurrentRecord & " of " & lngCount
      
              
      End Sub
      of which only first line is associated with the player

      This relates to a memo field in the form that contains the relative path to the mp3 file

      Comment

      • FishVal
        Recognized Expert Specialist
        • Jun 2007
        • 2656

        #4
        Try the following
        Code:
        Me.WindowsMediaPlayer7.Object.settings.autoStart = False

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32661

          #5
          You may also (as an alternative) get away with leaving line #2 out of the OnCurrent event procedure and adding it to the OnClick event procedure of your CommandButton instead.

          Comment

          • FishVal
            Recognized Expert Specialist
            • Jun 2007
            • 2656

            #6
            :-D

            I've just imagined that glamorous hi-fi WMP control and Access button "Play" or even "PLAY !!!" next to it. Mesalliance.

            Kind regards,
            Fish.

            Comment

            • colinod
              Contributor
              • Nov 2007
              • 347

              #7
              ive added the code after the original forst line and all is great

              thanks for your help

              Comment

              • FishVal
                Recognized Expert Specialist
                • Jun 2007
                • 2656

                #8
                You are welcome.

                BTW, I guess it would be enough to run this code once in Form_Load event handler. However, it is not that important.

                Comment

                • ChipR
                  Recognized Expert Top Contributor
                  • Jul 2008
                  • 1289

                  #9
                  Originally posted by FishVal
                  Mesalliance.
                  Learn Access tricks and increase your vocabulary at the same time! Thanks Fish!

                  Comment

                  Working...