Results 1 to 2 of 2
  1. #1
    JamesP
    Guest

    Sound, just for fun! :]

    Hi
    This is just something we wanted to play with on our database.
    I was attempting to get the data base that I am working with to play a wave file on response to an event with our using OLE objects if I can.
    I was given this code to put in the event property of a form,

    (=PlaySound("C:WINDOWSCHIMES.WAV"))

    but when I do the program states that it doesn't recognise the function. I tried it in both Access 97 and 2000 with the same result. I there a certain reference that I need as well?
    Or is there a better way?
    This is just something we wanted to play with on our database.
    I am using Win 98, though it will be running on NT Serv. 6 eventually.
    Thanks!

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sound, just for fun! :]

    Try adding the following code to the module. You may ned to to declare it as public, or have the call inside a module not on a form. (I hope it's OK, I've just copied it from MSDN Library).

    Private Declare Function PlaySound Lib "winmm.dll" _
    Alias "PlaySoundA" (ByVal lpszName As String, _
    ByVal hModule As Long, ByVal dwFlags As Long) As Long

Posting Permissions

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