473,890 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multi user login screen - question about tracking logged in users

44 New Member

I currently have a working multi user login form which automatically directs users to the relevent forms e.g. general staff have access to a form called staff1 and staff2 whereas managers have access to a form called manager1. I have used the following code:

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Private Sub Login_Click()
  3. UserName.SetFocus
  4. If UserName = "Staff1" And Password = "Staff1" Then
  5. MsgBox "Welcome"
  6. DoCmd.Close
  7. DoCmd.OpenForm "Staff1"
  8. ElseIf UserName = "Staff2" And Password = "Staff2" Then
  9. MsgBox "Welcome"
  10. DoCmd.Close
  11. DoCmd.OpenForm "Staff2"
  12. ElseIf UserName = "Manager1" And Password = "Manager1" Then
  13. MsgBox "Welcome, please exercise caution when changing query or table conditions", vbInformation, "CDSignatures"
  14. DoCmd.Close
  15. DoCmd.OpenForm "Manager1"
  16. Else
  17. MsgBox "Please re-enter Username and Password"
  18. End If
  19. End Sub
My question is how can I track users once they have logged in. I have a database which tracks data that has been editted from the main database and I would like to know how to show which user has done this.

Thanks in advance.
Oct 29 '12
55 9750
44 New Member
Hi Everyone, I know it has been a while since my last post and this is because everything now works fine and i haven't had the time to get back online to thank you all for all of your help.
Dec 5 '12 #51
32,584 Recognized Expert Moderator MVP
I'm pleased to hear that, but it may be helpful to anyone reading the thread if you posted an explanation of why it wasn't working and what you changed at that point to make it work.
Dec 5 '12 #52
44 New Member
I was able to login as normal using the code from post 35. However, it was not updating the usyscurrentuser table. I fixed this by changing the source of the form from nothing to the usyscurrentuser table. This worked, now when I log in it adds a new record into this table. Probably not the best way to sort the problem but it has worked and I am happy with it.
Dec 12 '12 #53
32,584 Recognized Expert Moderator MVP
Probably not a bad solution as it happens. It won't normally add a new user BTW, but update the existing one. At least after the first time. This is lucky, as if it added one it would be fundamentally useless to the process.

It is a known bug in the editor (at least to those of us that do a lot of programing) the MS doesn't seem to (or care to) want to fix.
I consider myself reasonably experienced in that area, but I hadn't heard that before ;-) I'll certainly bear it in mind in future. It does mean the code needs to be recompiled anyway - unless the object is closed without saving I suppose. Food for thought.
Dec 12 '12 #54
5,501 Recognized Expert Moderator Expert
Usually happens when the breakpoint trips and/or stepping thru code: then code is edited while in the debug state. Google "phantom break point." Been around since at least 97 when I first encountered it... wouldn't be surprised if there isn't something here on BYTES :)
(found one: http://bytes.com/topic/access/answer...en-starting-pc :)
Dec 12 '12 #55
32,584 Recognized Expert Moderator MVP
Oh that issue. I've had that a few times. Like one of the posters in the linked thread, I will simply add an edit, recompile and save. Typically though, although I will change code while running during the development cycle, I will redo it for release, and I never save an object with any breakpoints set, for that reason. Sometimes, with an object that is already supposed to be ready for release, but I have to make small tweaks to it, I'll close the object without saving, but after I've copied all the code to the clipboard, then reopen it, replace the code with the new, and close and save it then.

I've never seen this talked about before though. I just came up with my work-arounds after experiencing the problem a few times.

I still use breakpoints though, just within the parameters explained above. Clearly it makes sense to advise against relying on them for general consumption though. Good work as usual :-)
Dec 12 '12 #56

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Job Lot | last post by:
In a multi-user environment, how would I prevent users from adding Orders with identical OrderID. For instance I have following tables in my database Order ================== OrderID Identity field CustomerID OrderDate DeliveryAddress
by: Marcin Zmyslowski | last post by:
Hello all! I want to create a page in ASP language which gives me information about currently logged users. I thought to do it by this way: when somebody will log in to page, there will be a value of this user id stored in the table among the other fields in the form which are filling in. After clicking on the button "Log off" the value of the user id will be deleted from the MS SQL Server 2000 database. I would do it, but I don`t know...
by: dana lees | last post by:
Hello, I am developing a C# asp.net application. I am using the authentication and authorization mechanism, which its timeout is set to 60 minutes. My application consists of 2 frames - a header frame and a main frame. When i enter the application, i see the login screen on the whole screen, but when the authentication expires, the login screen appears on both frames.
by: planetthoughtful | last post by:
Hi All, I'm returning to coding in Access after a break of about 4 years, and designing a multi-user app split between a front end mdb for forms / code etc and a backend mdb for tables. I'm curious about how others persist information such as login IDs etc while each user is logged in. Previously I've used a hidden form with text fields on it to keep this information persisted, but I'm wondering if anyone would suggest other methods?
by: john | last post by:
Is it true that if I split my access database in backend and frontend and I implement custom auto increment for the ID fields, that my database is ready to be used in a multi-user environment? I found a zillion messages about auto increment and read some of them but it's confusing. Can someone point me to a simple custom auto increment example that I can download? Thank you, john
by: bala | last post by:
Hi Gurus The scenario A MS Access frontend application with Oracle Backend (Linked Tables). The Database UserID and password is not stored and each user has a unique UserID and password. There is no common database UserID and password. Each time the user logs in, the DSN UserID and Password screen is displayed. It has three input box and they are
by: TJO | last post by:
Can someone advise about feasibility of passing user credentials to an asp.net 2.0 application using query string or other techniques? I want to avoid the login screen. Thank you.
by: freee8896 | last post by:
Can nyone help me with this multi user login from the same system. Multiple users must be able to login from the same system at a time.... in PHP. Sessions must be used. Please donot suggest these following methods. 1 . Using a session cookie and passsing a unique id for each user using GET method. This fails when the url breaks at some page. the next page from then its not propogated. 2.Storing the users logged_in in the database n creating...
by: Stang02GT | last post by:
I am in the process of creating a database for a "Team" here at work. One thing that needs to be incorporated with this database is each user will have a log in and password I know how to do that. What I am not sure of is, I need the "Team Lead" to have Access to reports and different forms when he logs in. The other users should not have access to these items. Is it possible to assign user permission in access?
by: cobra35y | last post by:
Good Afternoon, I am new to the world of programming. after reviewing this site for info pertaining to my situation, i have declared a loss and posting for help. maybe i am just overlooking the situation, maybe just need a second set of eyes on this. i am in the military and have designed a unit database that allows for all kinds of tracking and reports generation for training meetings to licensing of soldiers on equipment and other...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.