Microsoft KB Archive/149119

= ACC: How to Record and Play Sounds from MS Access (95/97) =

Article ID: 149119

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q149119



Moderate: Requires basic macro, coding, and interoperability skills.



SUMMARY
This article shows you how to create a form for playing and recording sounds using the Windows Sound Recorder. The technique uses Visual Basic for Applications to open the Windows Sound Recorder and to control its functionality from Microsoft Access.

This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.



MORE INFORMATION
NOTE: The technique described in this article requires that you have the Windows Sound Recorder and a sound input device (such as a microphone) installed on your system. If your computer has a sound card, the Windows Sound Recorder is installed automatically when you set up Microsoft Windows 95 or later.

To play and record sounds, follow these steps:   Create the following new table in Design view:      Table: Messages ---     Field Name: Message Data Type: OLE Object  Save the table as Messages, and then close the table. Create a new form in Design view based on the Messages table.  Add the following controls to the form:      Bound Object Frame: Name: Message ControlSource: Message

Command Button: Name: RecordMessage Caption: Record

Command Button: Name: PlayMessage Caption: Play   Add the following event procedure to the OnClick property of the RecordMessage button: Me!Message.Class = "soundrec" Me!Message.Action = acOLECreateEmbed Me!Message.Verb = acOLEVerbPrimary Me!Message.Action = acOLEActivate </li>  Add the following event procedure to the OnClick property of the PlayMessage button: Me!Message.Action=7 </li> Switch the form to Form view.</li> To record a message, click the Record button to open the Windows Sound Recorder.</li> Record your message, and then click "Exit and Return to Messages" on the File menu. To play your recorded message, click the Play button.</li></ol>

<div class="references_section">