How do I count the users in a database?

J

Jeff Stroope

Hi,

I have a secured Access db with about 6 users, each with their own login
credentials.

How can I count how many users are in the database to determine whether or
not to take a particular action when a form closes? In other words,

If #users > 1 Then Do this Else Do that.
 
J

JString

There's probably a much better way to do this but incase you don't get any
other help, it's at least possible to create a table that stores the names of
active users which you could then use to count the number of active users.

CurrentUser will return the user's name, and a name table would be better
than a global counter because a counter would eventually lose the correct
count when somebody crashes before the front end can modify the counter's
value. If you use a name table, the problem could be easily corrected once
that user logs back on.
 
B

banem2

Hi,

I have a secured Access db with about 6 users, each with their own login
credentials.

How can I count how many users are in the database to determine whether or
not to take a particular action when a form closes?  In other words,

If #users > 1 Then Do this Else Do that.

Check this, looks like the solution for your problem:

http://support.microsoft.com/kb/198755/EN-US/

Regards,
Branislav Mihaljev
Microsoft Access MVP
 
J

Jeff Stroope

Thanks JString - that's exactly what I'm going to do. It's so simple...how
come I didn't think of it?
 
T

Tony Toews [MVP]

Jeff Stroope said:
How can I count how many users are in the database to determine whether or
not to take a particular action when a form closes? In other words,

Just curious. Why do you want to do this?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top