How do I code in a text box the number of users in a form,
What I need is as a person opens a form if they are the
second person in the form need them to see 2 …and so on?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Want to show the number of users in a form (accessXP)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Want to show the number of users in a form (accessXP)
- This topic has 12 replies, 6 voices, and was last updated 22 years, 6 months ago.
AuthorTopicViewing 0 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerNovember 8, 2002 at 12:46 pm #630227Microsoft provides a way of counting or listing all users who are logged in to a database: see
HOW TO: Check Who Logged into Database with Jet UserRoster in Access 2000.Counting the number of users who have opened a form is trickier. You could create a table with two fields: FormName (text) and UserCount (numeric, integer, default value 0). Create a record in this table for each form you want to monitor.
You would have to write code in the OnLoad event of the form to add 1 to the UserCount field of the record corresponding to the form (and displaying the new UserCount in a text box), and in the OnClose event of the form to subtract 1 again.
But … if the form isn’t closed properly (Access crashes, or the user pulls the plug, or power fails), the OnClose event doesn’t occur, so UserCount won’t be decreased. I don’t know how to get around this, apart from periodically setting all UserCounts to 0 at a moment you are sure that nobody has a form open. -
Richard Arlington
MemberNovember 8, 2002 at 7:48 pm #630357Hans:
Thanks for the suggested MSKB article link. Have got it working in one of my “secured” apps. I specified the backend (full path) in the “Data Source” code lines since it seemed to make sense that the backend was the part that had multiple simultaneous users.
Since this is a “normal” split situation (backend on the server / frontend and .mdw file on the workstations) I was surprised to find that it showed me logged in to the back end as ‘Admin’. I thought I had a pretty good understanding of Access Security, having worked with it for a few years. Now I guess I’m missing something. Security was handled before splitting the app. The normal make new workgroup file, join it, give Admin a password, create a new user (myself) in Admins Group, take Admin out of Admins, import everything to a new database under the new workgroup so I’m the “owner”, create necessary users and groups, assign permissions to the Groups depending on function, and take all permissions away from the Users group. Then the database gets split and the backend placed on the server.
Then a shortcut is created calling the appropriate security .mdw file, and I rejoin System.mdw (where all workstations are). The frontend mdb and the security mdw files are placed in a new directory on the workstations and linked to the server backend. The shortcut goes on the desktop.
Since Admin is now part of Users only and that group has NO permissions, how can Admin be showing up as logged at my workstation? When checking permissions, the linked backend tables show the proper group permissions (Admin has none!)
I guess my question is: If I need to provide additional security for the back end, how do I do it? My “bible” (MS Security FAQ) seems to have been leading me in circles today. Maybe someone can help. I’m probably missing something obvious and am over analyzing.
Thanks
-
WBell
AskWoody_MVPNovember 8, 2002 at 8:16 pm #630365Are you getting a login prompt when you start the short-cut? If not, you are really logging in as Admin. This can get mighty confusing when you are working with multiple .mdw files, so you may not be using the security file you think you are. A shot in the dark, but sometimes this business requires it.
-
Richard Arlington
MemberNovember 8, 2002 at 8:22 pm #630368 -
WScharlotte
AskWoody Lounger -
WBell
AskWoody_MVPNovember 9, 2002 at 3:19 pm #630473Hi Dick,
Does your shortcut include the full path to msaccess.exe? If not, I seen this kind of thing cause the default .mdw file to be used, which will cause all sorts of funnies. Run the tool against both the FE and the BE and see what it tells you about who is logged in. As far as the logged in as Access part, that can also happen as long as Admin is still the owner of the database. If you do what you described, but using the security wizard, I’m sure you’ll find it all hangs together. And I appreciate that hanging together for us “more mature” loungers – we could even include Charlotte! -
Richard Arlington
MemberNovember 11, 2002 at 12:34 pm #630767Wendell & Charlotte,
Thanks for the replies. Stayed out of the office Sat & Sun, but am back in today. My intention is to go back over all steps beginning with creating and joining the work group, making a new database, and importing all files including the backend data files. That way there’s no question about my being the “owner”, although the current fe security shows me as the owner. I work in a directory called “Shared”. The database and mdw files are in c:shared.
Full shortcut text is as follows: “c:program filesmicrosoft officeofficemsaccess.exe” c:sharedMitProj.mdb /wrkgrp c:sharedMitProj.mdw (My usual practice is to create the mdw file with the same name as the mdb file, which avoids confusing myself.)
Once the new db is split, is it necessary to reapply security separately to the backend? If so, this is probably what I’m missing. BTW I’ve tried the Security Wizard a few times, but don’t regularly use it since I thought I finally understood the security routine.
Thanks for the input … am off to rebuild the whole thing.
-
WScharlotte
AskWoody Lounger -
Richard Arlington
Member -
Richard Arlington
MemberNovember 12, 2002 at 4:12 pm #631185Charlotte and Wendell:
Thanks … everything working correctly. Now when someone tries to open the back end on the server by double clicking the file, the “You don’t have the necessary permissions …” message.
I had been missing the obvious — Open the back end and secure the objects!
Thanks again,
-
WScharlotte
AskWoody Lounger
-
-
-
-
WSSupport4John
AskWoody LoungerNovember 9, 2002 at 2:52 pm #630464
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Who knows what?
by
Will Fastie
29 minutes ago -
My top ten underappreciated features in Office
by
Peter Deegan
21 minutes ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
5 hours, 22 minutes ago -
Misbehaving devices
by
Susan Bradley
32 minutes ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
23 hours, 1 minute ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
3 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
21 hours, 35 minutes ago -
Discover the Best AI Tools for Everything
by
Alex5723
21 hours, 44 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
11 hours, 53 minutes ago -
Rufus is available from the MSFT Store
by
PL1
19 hours, 55 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
1 day, 22 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
1 day, 5 hours ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
54 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
1 day, 18 hours ago -
Office gets current release
by
Susan Bradley
1 day, 21 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
3 days, 11 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
2 days, 19 hours ago -
Stop the OneDrive defaults
by
CWBillow
3 days, 12 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
3 days, 21 hours ago -
X Suspends Encrypted DMs
by
Alex5723
4 days ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
4 days ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
4 days, 1 hour ago -
OpenAI model sabotages shutdown code
by
Cybertooth
4 days, 1 hour ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
3 days, 13 hours ago -
Enabling Secureboot
by
ITguy
3 days, 20 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
4 days, 9 hours ago -
No more rounded corners??
by
CWBillow
4 days, 5 hours ago -
Android 15 and IPV6
by
Win7and10
3 days, 19 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
4 days, 21 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
5 days ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.