Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 210067 - Last Review: October 11, 2006 - Revision: 2.2
ACC2000: How to Record and Play Sounds from Microsoft Access
This article was previously published under Q210067
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
This article shows you how to create a form that used Windows Sound Recorder to play and to record sounds. The technique uses Visual Basic for Applications code to open Sound Recorder and to control its functionality from Microsoft Access.
NOTE: To use this technique, you must have Sound Recorder and a sound input device, such as a microphone, installed on your computer. If your computer has a sound card, Sound Recorder is installed automatically when you set up Microsoft Windows 95 or later.
To play and record sounds, follow these steps:
- Start Microsoft Access, and then open the sample database Northwind.mdb.
- Create the following 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 command button:
Private Sub RecordMessage_Click()
With Me.Message
.Class = "soundrec"
.Action = acOLECreateEmbed
.Verb = acOLEVerbPrimary
.Action = acOLEActivate
End With
End Sub
- Add the following event procedure to the OnClick property of the PlayMessage command button:
Private Sub PlayMessage_Click()
Me.Message.Action = 7
End Sub
- Save the form as Messages, and then open it in Form view.
- To record a message, click the Record command button to open Sound Recorder.
- Record your message, and then on the File menu, click Exit and Return to Form. To play your recorded message, click the Play command button.
For more information about using Microsoft Access as an OLE Automation controller, click
Microsoft Visual Basic Help on the
Help menu, type
understanding automation in the Office Assistant or
the Answer Wizard, and then click
Search to view the topics
returned.
APPLIES TO
- Microsoft Access 2000 Standard Edition
| kbhowto kbinfo kbinterop KB210067 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate