f



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

I've followed the instructions found on Microsoft's site...
http://support.microsoft.com/default.aspx?scid=kb;en-us;149119&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.
0
CRCI (2317)
11/5/2003 12:15:11 AM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

6 Replies
1448 Views

Similar Articles

[PageSpeed] 52

get the PlaySound cod from www.mvps.org.  That should work in Access
2.  Check the modules section.
0
pietlinden (2926)
11/5/2003 7:10:44 AM
Hey thanks! I'll give it a shot.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


On 4 Nov 2003 23:10:44 -0800, pietlinden@hotmail.com (Pieter Linden)
wrote:

>get the PlaySound cod from www.mvps.org.  That should work in Access
>2.  Check the modules section.

0
CRCI (2317)
11/5/2003 10:11:06 AM
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.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
0
CRCI (2317)
11/5/2003 10:22:15 AM
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...
0
pietlinden (2926)
11/5/2003 2:56:06 PM
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.
0
CRCI (2317)
11/6/2003 7:36:24 PM
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" <CRCI@NorthState.net> schreef in bericht news:e4ggqv8o63o6oocg4o5orsovlea2v6t7id@4ax.com...
>
> I've followed the instructions found on Microsoft's site...
> http://support.microsoft.com/default.aspx?scid=kb;en-us;149119&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.



0
11/6/2003 10:52:37 PM
Reply: