By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,637 Members | 1,967 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,637 IT Pros & Developers. It's quick & easy.

Playing & recording WAVE-type sound in MS Access - could Me!Message.Action = 7 value assignment differ if I'm using Access 2.0?

P: n/a
MLH

I've followed the instructions found on Microsoft's site...
http://support.microsoft.com/default...&Product=acc97

Here are those instructions...

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

Add the following event procedure to the OnClick property of the
PlayMessage button:Me!Message.Action=7

Switch the form to Form view.
To record a message, click the Record button to open the Windows Sound
Recorder.
Record your message, and then click "Exit and Return to Messages" on
the File menu. To play your recorded message, click the Play button.
Works fine in Access 95/97, but when I run it in Access 2.0, it pukes
on the Me!Message.Action = 7 line.

Anybody know why that may be? I know Access
2.0 is old and unsupported... etc, but so am I.
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
get the PlaySound cod from www.mvps.org. That should work in Access
2. Check the modules section.
Nov 12 '05 #2

P: n/a
MLH
Hey thanks! I'll give it a shot.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 4 Nov 2003 23:10:44 -0800, pi********@hotmail.com (Pieter Linden)
wrote:
get the PlaySound cod from www.mvps.org. That should work in Access
2. Check the modules section.


Nov 12 '05 #3

P: n/a
MLH
Oh, well, as luck would have it. My search there for 'playsound'
turned up 5 hits, but none of them reeked of 16-bit stuff.
Unfortunately for me, I'm afraid. I couldn't specifically identify
the 'modules section'.

Thanks anyway, Pieter. I appreciate the suggestion.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxx
Nov 12 '05 #4

P: n/a
sorry, got lazy. here's the full address for the PlaySound API function:

http://www.mvps.org/access/api/api0011.htm

not sure about recording...
Nov 12 '05 #5

P: n/a
MLH
Well, I tried it.
However, when this line ran...

lngRet = apiPlaySound(strFilename, intPlayMode)

Access 2.0 returned a msg saying "Error in Loading DLL"

I'll test this in Access 97 2C if the error occurs there.
Nov 12 '05 #6

P: n/a
Try this:
Dump this in a module (I called it basWav...) (watch for line-wrap)
Declare Function csvSndPlaySound Lib "MMSYSTEM.DLL" Alias "SndPlaySound" (ByVal FileName As String,
ByVal How As Integer) As Integer
Function csvPlayWave (ByVal FileName As String, ByVal How As Integer) As Integer
csvPlayWave = csvSndPlaySound(Trim(FileName), How)
'Example:
'Dim lngRetkode as long
'lngRetkode =csvPlayWave("c:\windows\media\tada.wav", 1)
End Function

Works in Access 2.0 on my PC ...

--
Hope this helps
Arno R
"MLH" <CR**@NorthState.net> schreef in bericht news:e4********************************@4ax.com...

I've followed the instructions found on Microsoft's site...
http://support.microsoft.com/default...&Product=acc97

Here are those instructions...

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

Add the following event procedure to the OnClick property of the
PlayMessage button:Me!Message.Action=7

Switch the form to Form view.
To record a message, click the Record button to open the Windows Sound
Recorder.
Record your message, and then click "Exit and Return to Messages" on
the File menu. To play your recorded message, click the Play button.
Works fine in Access 95/97, but when I run it in Access 2.0, it pukes
on the Me!Message.Action = 7 line.

Anybody know why that may be? I know Access
2.0 is old and unsupported... etc, but so am I.


Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.