Sound File

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that requeries every 30 seconds in the background - it's a currentuser list of my Main database (the form is on the Manager database)

So, what I want to do is this:
if the list of users increases or decreases as a result of the requery, I'd like to add a ding.wav to it. I'm sure that this can be done (seems just about everything can be done in Access), but I'm not sure how to make this happen

Can someone please help me out with it

Thanks
Derek
 
Hi,


See apiPlaySound at http://www.mvps.org/access/api/api0011.htm


Hoping it may help,
Vanderghast, Access MVP


Derek Wittman said:
I have a form that requeries every 30 seconds in the background - it's a
currentuser list of my Main database (the form is on the Manager database).
So, what I want to do is this:
if the list of users increases or decreases as a result of the requery,
I'd like to add a ding.wav to it. I'm sure that this can be done (seems
just about everything can be done in Access), but I'm not sure how to make
this happen.
 
Thanks. Only, it's not so much the playing of the sound as the criteria to fire the sound playing. I've seen the code in The Access Web (I have it offline, too). But I need the sound to play at the right time

Thanks
Dere

----- Michel Walsh wrote: ----

Hi


See apiPlaySound at http://www.mvps.org/access/api/api0011.ht


Hoping it may help
Vanderghast, Access MV


Derek Wittman said:
I have a form that requeries every 30 seconds in the background - it's
currentuser list of my Main database (the form is on the Manager database)
if the list of users increases or decreases as a result of the requery
I'd like to add a ding.wav to it. I'm sure that this can be done (seem
just about everything can be done in Access), but I'm not sure how to mak
this happen
 
Apparently you have code in the OnTimer event of your form. Add the following to
your code:

Right after the first line:
Dim Rst As DAO.Recordset
Dim PreRequeryCount As Long
Dim PostRequeryCount As Long

Before the Requery Statement:
Set Rst = Me.RecordsetClone
Rst.MoveLast
PreRequeryCount = Rst.RecordCount

After the Requery Statement:
PostRequeryCount = Rst.RecordCount
If PostRequeryCount <> PreRequeryCount Then
<<Your Code To Play Sound>>
End If
Rst.Close
Set Rst = Nothing


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



Derek Wittman said:
I have a form that requeries every 30 seconds in the background - it's a
currentuser list of my Main database (the form is on the Manager database).
So, what I want to do is this:
if the list of users increases or decreases as a result of the requery, I'd
like to add a ding.wav to it. I'm sure that this can be done (seems just about
everything can be done in Access), but I'm not sure how to make this happen.
 
Not code. I'm calling up a macro. I could convert that macro to code, though, I am sure

----- PC Datasheet wrote: ----

Apparently you have code in the OnTimer event of your form. Add the following t
your code

Right after the first line
Dim Rst As DAO.Recordse
Dim PreRequeryCount As Lon
Dim PostRequeryCount As Lon

Before the Requery Statement
Set Rst = Me.RecordsetClon
Rst.MoveLas
PreRequeryCount = Rst.RecordCoun

After the Requery Statement
PostRequeryCount = Rst.RecordCoun
If PostRequeryCount <> PreRequeryCount The
<<Your Code To Play Sound>
End I
Rst.Clos
Set Rst = Nothin


-
PC Datashee
Your Resource For Help With Access, Excel And Word Application
(e-mail address removed)
www.pcdatasheet.co



Derek Wittman said:
I have a form that requeries every 30 seconds in the background - it's
currentuser list of my Main database (the form is on the Manager database)
if the list of users increases or decreases as a result of the requery, I'
like to add a ding.wav to it. I'm sure that this can be done (seems just abou
everything can be done in Access), but I'm not sure how to make this happen
 
Thanks!

However, here's the odd thing. I have run the Macro --> VBA conversion. And the simple 'requery' action that was on the timer isn't working from the VBA.

I'm not sure why. Any ideas?

Thanks!
Derek

----- PC Datasheet wrote: -----

Apparently you have code in the OnTimer event of your form. Add the following to
your code:

Right after the first line:
Dim Rst As DAO.Recordset
Dim PreRequeryCount As Long
Dim PostRequeryCount As Long

Before the Requery Statement:
Set Rst = Me.RecordsetClone
Rst.MoveLast
PreRequeryCount = Rst.RecordCount

After the Requery Statement:
PostRequeryCount = Rst.RecordCount
If PostRequeryCount <> PreRequeryCount Then
<<Your Code To Play Sound>>
End If
Rst.Close
Set Rst = Nothing


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



Derek Wittman said:
I have a form that requeries every 30 seconds in the background - it's a
currentuser list of my Main database (the form is on the Manager database).
if the list of users increases or decreases as a result of the requery, I'd
like to add a ding.wav to it. I'm sure that this can be done (seems just about
everything can be done in Access), but I'm not sure how to make this happen.
 
The code is:
Me.Requery

Steve
PC Datasheet

Derek Wittman said:
Thanks!

However, here's the odd thing. I have run the Macro --> VBA conversion. And
the simple 'requery' action that was on the timer isn't working from the VBA.
 
That was simple enough! Thanks!! Now it's time to put the ding into it

Dere

----- PC Datasheet wrote: ----

The code is
Me.Requer

Stev
PC Datashee
 
Thanks again. Unfortunately, I seem to be struggling with this..

Here's the code I have so far, mostly thanks to you

Private Sub Form_Timer(
Dim Rst As DAO.Recordse
Dim PreRequeryCount As Lon
Dim PostRequeryCount As Lon

On Error GoTo Err_Form_Time

Set Rst = Me.RecordsetClon
Rst.MoveLas
PreRequeryCount = Rst.RecordCoun
Me.Requer
PostRequeryCount = Rst.RecordCoun
If PostRequeryCount <> PreRequeryCount The
<<Your Code To Play Sound>
------- I try to put in Dev's code for the Wav/MP3 files and get this message: Compile Error. Only comments may appear after End Sub, End Function, or End Property----------

End I
Rst.Clos
Set Rst = Nothin
Exit_Form_Timer
Exit Functio

Err_Form_Timer
MsgBox Err.Descriptio
Resume Exit_Form_Time

End Functio


----- PC Datasheet wrote: ----

Apparently you have code in the OnTimer event of your form. Add the following t
your code

Right after the first line
Dim Rst As DAO.Recordse
Dim PreRequeryCount As Lon
Dim PostRequeryCount As Lon

Before the Requery Statement
Set Rst = Me.RecordsetClon
Rst.MoveLas
PreRequeryCount = Rst.RecordCoun

After the Requery Statement
PostRequeryCount = Rst.RecordCoun
If PostRequeryCount <> PreRequeryCount The
<<Your Code To Play Sound>
End I
Rst.Clos
Set Rst = Nothin


-
PC Datashee
Your Resource For Help With Access, Excel And Word Application
(e-mail address removed)
www.pcdatasheet.co



Derek Wittman said:
I have a form that requeries every 30 seconds in the background - it's
currentuser list of my Main database (the form is on the Manager database)
if the list of users increases or decreases as a result of the requery, I'
like to add a ding.wav to it. I'm sure that this can be done (seems just abou
everything can be done in Access), but I'm not sure how to make this happen
 
Back
Top