How to tell if other users logged in to DB (1 Viewer)

Ally

Registered User.
Local time
Today, 17:52
Joined
Sep 18, 2001
Messages
617
Is there a way, in VBA of telling if another user is logged on, (apart from looking for an .ldb) please?

I have put a compact db command button on a db (instead of on exit of application) as it’s a multi-user application. What I’ve done is put a button on so that the main user can do it at the end of the day when she knows there’s no-one else logged in.

Ideally, I’d put in something along the lines of:

Code:
If NoOtherUsersLoggedIn then
  SendKeys “%TDC”
  Quit

Else
  Quit

EndIf
 

llkhoutx

Registered User.
Local time
Today, 11:52
Joined
Feb 26, 2001
Messages
4,018
I've trap the UserID when a user logs onto the database. When a user crash occurs he stays logged in. However, it's works well although is not fool proof.
 

Ally

Registered User.
Local time
Today, 17:52
Joined
Sep 18, 2001
Messages
617
How do you trap the UserID?
 

Ally

Registered User.
Local time
Today, 17:52
Joined
Sep 18, 2001
Messages
617
Thanks Peter. Unfortunately, the "Who's Logged In" says you must have User Level Security implemented and the LDB viewer is for Acc 2000 - I'm using Acc '97.

For the time being I've got around it, as I found another form that can tell you who's logged in. I've got that to open when the user clicks 'Compact DB' and if there's anyone other than them logged on, they close, if not they can compact.
 

John.Woody

Registered User.
Local time
Today, 17:52
Joined
Sep 10, 2001
Messages
354
If you've got a form that tells you which other users are logged in you should be able to count the number of users logged in
if > 1 then quit
Else
Compact
quit

HTH
John
 

Ally

Registered User.
Local time
Today, 17:52
Joined
Sep 18, 2001
Messages
617
We tried doing this already - somewhere along the line it was going wrong. In a msgbox, whether there was 1 user or 5, it told us there was 4 even though on the form it clearly showed who was logged in. Also, if a user logged out during this time, and we clicked refresh, it didn't! Being someone elses code, we haven't quite cracked the problem yet.
 

Users who are viewing this thread

Top Bottom