Results 1 to 4 of 4
  1. #1
    rwahdan1978 is offline Advanced Beginner
    Windows 11 Access 2016
    Join Date
    Jun 2024
    Posts
    57

    How to delay part of code until WMP finishes playing?

    Hi



    I have the following code:

    Code:
                WMP3.URL = "C:\Users\ramit\OneDrive\Desktop\images\correct.mp3"
                DoCmd.OpenQuery "updateAhmad"
                AhmadScore = AhmadScore + 100
                Forms("main").ahmad = AhmadScore
                Forms![Main].Visible = True
                DoCmd.Close acForm, "form1"
    It is ok but since I am closing the form and opening another form the player is not playing. I want to play the sound then do the rest of the code. How o do that? I tried the sleep option but it is freezing everything even the player then goes to the new form.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    If you know how long the sound plays, try the pause function

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Edgar is offline Competent Performer
    Windows 8 Access 2016
    Join Date
    Dec 2022
    Posts
    309
    You could have the player in a hidden form dedicated to sound. Or have the player in a form that never closes, like possibly the main form.
    Please click on the ⭐ below if this post helped you.


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 07-07-2017, 06:22 AM
  2. Replies: 3
    Last Post: 12-11-2015, 07:34 AM
  3. Clean up screen after Error Handler finishes.
    By Phred in forum Programming
    Replies: 2
    Last Post: 02-11-2015, 01:41 PM
  4. Replies: 17
    Last Post: 11-05-2013, 04:19 AM
  5. Last Part of code not working
    By mejia.j88 in forum Programming
    Replies: 19
    Last Post: 02-22-2012, 12:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums