lorenzoaj
01-06-2002, 09:16 PM
Is there a way to add sound to a control button on a Form? Any help would be greatly appreciated.
|
View Full Version : Adding Sound lorenzoaj 01-06-2002, 09:16 PM Is there a way to add sound to a control button on a Form? Any help would be greatly appreciated. ALANBELL1 01-07-2002, 01:25 AM Lorenzoaj, You can certainly play a wave sound in Access by inserting a wave sound object in your form.Suppose your wave sound object was called snd1, to play the sound you would code Me!snd1.Action = acOLEActivate. Hope this helps. Regards, Alan lorenzoaj 01-07-2002, 11:36 AM I am kinda new to access and VBA. Everything I've learned I've learned by trial and error and on my own. How do I import the wav file or have it access the wave file. I want to put it in the On_Click Event. wizcow 01-07-2002, 07:53 PM lorenzoaj Try this; Get the sound onto your form so your button can access it. 1. Open your form in design view 2. Select 'object...' from the 'insert' menu. The 'Insert Object' form opens 3. Scroll to the bottom of the 'object type' listbox and select 'wave sound' 4. Click ok, 'sound object' form opens 5. Select 'insert file' from the 'edit' menu 6. Browse for your .Wav file and open it. You should now have an OLE object on your form. 7. Select the OLE object and rename it, say, 'snd1' 8. You can also set the visible property to 'No' if you want ot hide it. now you can tie your button to the sound 1. In the click event of the button, select [event procedure] click the '...' button beside it. This opens the VB window. 2. Add ALANBELL1's code Me!snd1.Action = acOLEActivate That should work. Good Luck Tom [This message has been edited by wizcow (edited 01-07-2002).] [This message has been edited by wizcow (edited 01-07-2002).] lorenzoaj 01-07-2002, 08:11 PM It worked great. Thanks for all your help. This forum has really helped me learn alot. |