Is there vba code that can be run in a macro on a win2k networked pc that will allow me to check whether another user is logged on elsewhere?
Thanks.
Tony.
***NOT TESTED***, i dont know were i grabed this, but its here.
---
The remote log out can be automatised in simply changing one single value in a table field of the backend.
The following steps are necessary:
Create a field [LogOutStatus] in a system table of the backend that holds the values 1, 2 or 3
Create a form in the frontend that stays open permanently (hidden)
Activate the timer interval of this form
Write code for the OnTimer event to control the field [LogoutStatus]
Write code to leave the frontend
Write code to verify the content of [LogOutStatus] on opening the frontend
The functioning:
The OnTimer-Event checks the value of [LogOutStatus]:
1 = nothing
2 = Display message "Application will shut down in a moment
3 = Another message Message if desired and closing frontend
On opening the frontend the same test has to be made.
Code examples:
Ontimer-Event select case dlookup("[LogOutStatus]","tblSystem"
case 1
' nothing
case 2
call MessageBeforeShutDown
case 3
' special Code for your application
application.quit
end select
Sub MessageBeforeshutdown
dim strMessage as string
strMessage="ATTENTION: The database has to be shut down in 5 minutes" _r> & "Please finish your work and leave the program."
msgbox strMessage
end sub
Please note:
- The time between changing the value of [LogOutStatus] and the shut-down of the frontends depends on the setting of the timer interval
- You need to control via VBA that the data manipulation will be terminated correctly
- All open objects have to be closed on shut-down
- You need to inform the users when the application is up again Best Regards
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.