Assessment Package 3 for ISDD (Backpacker Holidays)

  • martymac

    Step 4 of the assessment requires a database form that opens automatically and then plays a short sound clip. Is anyone able to help me with playing a sound clip from a form in MS Access 2013?


    There is no built in sound function for Databases. You need to add it in.

    Go to the Create tab, and select Module. This will open a programming window. Add the following code

    Declare Function apisndPlaySound Lib “winmm” Alias “sndPlaySoundA” _
    (ByVal filename As String, ByVal snd_async As Long) As Long

    Function PlaySound(sWavFile As String)
    ‘ Purpose: Plays a sound.
    ‘ Argument: the full path and file name.

    If apisndPlaySound(sWavFile, 1) = 0 Then
    MsgBox “The Sound Did Not Play!”
    End If
    End Function

    Save it as “Sounds” and close the window.
    Go to the form the sound will play on, right click the object and choose Properties (or Form Properties if the sound is for the form itself).
    Add the following bit of code, with the path to the correct file, to the appropriate property in the event tab.

    For example, if the sound if to play when the Form is opened:
    1. Right click and choose Form Properties
    2. Add the code to the OnLoad property of the Event Tab


    Magic – thanks so much for that, and for the quick response. I would never have figured that out by myself

    Susan Thomson

    You can add sound to an Access form, without the need for programming. I have uploaded a help sheet. This also works in Access 2013.

    deborah blackburn

    I would go with the coding method as pupils have to code at least 2 elements to attain the assessment criteria.

    Susan Thomson

    Coding is covered by the validation and the update anyway (see below). Seems like extra work to me.

    We are doing the new Higher this year and I am finding it a challenge to get all the assessment completed in time (there is so much of it) so I am going for the quickest and simplest routes.

    Hope that helps


    “The following is the list of potential opportunities for candidate to write short sections of code:
    • restricting phone number to exactly 11 characters
    • validating the number of stars
    • the price increases in Step 6″


    If there is no requirement for pupils to code the sound file aspect, then I’ll go with adding it using media player. Really pushed for time at the moment, maybe next year I’ll be better prepared and might have the time to go down the coding route.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.