forcing sounds to play

  • Thread starter Thread starter OTWarrior via AccessMonster.com
  • Start date Start date
O

OTWarrior via AccessMonster.com

the database has a logout proceedure, which unfortunately one person often
forgets to log out at the end of the day, so he doesn't get the updates. He
often stays late, so I have written some code to prompt him with a messagebox
when it is after 5:30 to logout.

However, I also want a sound file to play when this messagebox loads, which i
have the code to do.

What I really want to know is can you unmute the sound on a computer and set
the sound level (so it is not too loud, but enough to get his attention)? or
does this border on hacking?
 
Yes, it borders on hacking. Settings like screen appearance, volume and the
like are all user settings, meaning that the user chooses what they should
be. There might be a very good reason that the user has the sound level
turned down, and we as developers shouldn't be second guessing him.

Why not use the approach outlined in http://support.microsoft.com/kb/210297
and actually log him out after 5:30? Give him a warning, of course, but if
he chooses to ignore the warning, it's his own fault if he loses some work.
 
Golly, what happens if he goes home early?

What use is some annoying sound and a msgbox in some cubicle?

If some software un-muted my sound settings, I would NEVER use that software
again. Further, if I was forced to use the software, then I would un-plug my
speakers.....

That sounds like a Dilbert management solution here.

Why not just have some code that exits the database if there is not activity
after 1/2, or perhaps one hour?

a2000 idle time kick users out can be found here:

http://support.microsoft.com/default.aspx?scid=kb;en-us;210297
 
far as I am aware you can't log off someones computer from access, and any
code that would normally run does not function when the computer is locked.
Does that code work in that situation?

This is just a gentle reminder for the user to log out before he leaves.

It was more I wanted to know if it was possible, than fully implement it.
Plus they HAVE to use the database for their job and they are meant to
shutdown their computer before they leave, which they aren't. Hence the
reminder.

Although, I do admit it is a bit Dilbert mangement stylee ;)
 
As a matter of fact, you CAN log someone off the network from Access using
either API calls or by calling shutdown.exe (which should be in the System32
folder). In fact, you can even shut down the computer if you want.

However, I suspect all Albert is talking about is shutting down the
application that's running in Access. That's precisely what the link he
cited shows how to do.
 
OTWarrior via AccessMonster.com said:
the database has a logout proceedure, which unfortunately one person often
forgets to log out at the end of the day, so he doesn't get the updates.
He
often stays late, so I have written some code to prompt him with a
messagebox
when it is after 5:30 to logout.

However, I also want a sound file to play when this messagebox loads,
which i
have the code to do.

What I really want to know is can you unmute the sound on a computer and
set
the sound level (so it is not too loud, but enough to get his attention)?
or
does this border on hacking?

Here's some code you can use to set a time for the app to close
automatically. You'll need a table "tblShutdown" with fields "Value" and
"Type" and a query "qtblShutdown" based on it. The code goes into the timer
event of a hidden form or a form that's always loaded. I have the timer
interval set to 30 seconds.

You can use it to target certain users and computers or to set a time for
shutdown to occur. To get the app to shutdown at 17:30, put that time in
the "Value" field and put "time" into the "Type" field. "fdlgShutdown" is
the form that appears to warn the user(s) that a forced shutdown is
occurring. You also need to call the code when your app opens so that new
users are kept out. This isn't the full solution but you should be able to
work out what other bits are needed.

Hope it helps.

Keith.
www.keithwilby.com

On Error Resume Next
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim dtmTimeOut As Date
Dim varType As Variant
Dim varValue As Variant

Set db = CurrentDb()
Set rs = db.OpenRecordset("qtblShutdown")
Do While Not rs.EOF
varValue = rs!Value
If Not IsNull(varValue) Then
Select Case rs!Type
Case "User"
If varValue = fOSUserName() Then
DoCmd.OpenForm "fdlgShutdown", , , , , acDialog
mfTimedOut = True
DoCmd.Close acForm, Me.Name
End If
Case "Computer":
If varValue = fOSMachineName Then
DoCmd.OpenForm "fdlgShutdown", , , , , acDialog
mfTimedOut = True
DoCmd.Close acForm, Me.Name
End If
Case "Time"
dtmTimeOut = varValue
If mdtmTime < dtmTimeOut And Time > dtmTimeOut Then
DoCmd.OpenForm "fdlgShutdown", , , , , acDialog
mfTimedOut = True
DoCmd.Close acForm, Me.Name
End If
End Select
End If
rs.MoveNext
Loop

End If
 
OTWarrior via AccessMonster.com said:
far as I am aware you can't log off someones computer from access, and any
code that would normally run does not function when the computer is
locked.
Does that code work in that situation?

IT should. IT would at least work as well as code that make a sound after a
certain amount of time....

So, yes...it should exit the program as long as the user is not stuck in a
dialog prompt......

I used this for a number of clients, and it works well. Even when their
workstation is un-attended, and locked....
 
Back
Top