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?
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
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, 5 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
-
How much I spent on the Mac mini
by
Will Fastie
4 minutes ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
1 hour, 22 minutes ago -
Spring cleanup — 2025
by
Deanna McElveen
12 minutes ago -
Setting up Windows 11
by
Susan Bradley
5 hours, 33 minutes ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
5 hours, 53 minutes ago -
Powershell version?
by
CWBillow
2 hours, 38 minutes ago -
SendTom Toys
by
CWBillow
6 hours, 57 minutes ago -
Add shortcut to taskbar?
by
CWBillow
28 minutes ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
16 hours, 51 minutes ago -
How can I install Skype on Windows 7?
by
Help
15 hours, 33 minutes ago -
Logitech MK850 Keyboard issues
by
Rush2112
10 hours, 18 minutes ago -
We live in a simulation
by
Alex5723
1 day, 6 hours ago -
Netplwiz not working
by
RetiredGeek
17 hours, 33 minutes ago -
Windows 11 24H2 is broadly available
by
Alex5723
1 day, 19 hours ago -
Microsoft is killing Authenticator
by
Alex5723
7 hours, 2 minutes ago -
Downloads folder location
by
CWBillow
2 days, 1 hour ago -
Remove a User from Login screen
by
CWBillow
21 hours, 28 minutes ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
1 day, 16 hours ago -
Microsoft Speech Recognition Service Error Code 1002
by
stanhutchings
1 day, 17 hours ago -
Is it a bug or is it expected?
by
Susan Bradley
1 day, 21 hours ago -
Image for Windows TBwinRE image not enough space on target location
by
bobolink
1 day, 16 hours ago -
Start menu jump lists for some apps might not work as expected on Windows 10
by
Susan Bradley
15 hours, 37 minutes ago -
Malicious Go Modules disk-wiping malware
by
Alex5723
2 days, 5 hours ago -
Multiple Partitions?
by
CWBillow
2 days, 6 hours ago -
World Passkey Day 2025
by
Alex5723
2 hours, 39 minutes ago -
Add serial device in Windows 11
by
Theodore Dawson
3 days, 15 hours ago -
Windows 11 users reportedly losing data due forced BitLocker encryption
by
Alex5723
1 day, 15 hours ago -
Cached credentials is not a new bug
by
Susan Bradley
3 days, 19 hours ago -
Win11 24H4 Slow!
by
Bob Bible
3 days, 19 hours ago -
Microsoft hiking XBox prices starting today due to Trump’s tariffs
by
Alex5723
3 days, 16 hours ago
Recent blog posts
Key Links
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.