Hi, Thanks and its looks a great work from you.
I will review it in further details and get back to you.
Thanks for your support.
Hi, Thanks and its looks a great work from you.
I will review it in further details and get back to you.
Thanks for your support.
Hello, I gone through this DB and its really a fantastic logical work. I also saw many other examples provided at ur Web and i can say its totally new world for new comers like me. I appreciate your work and sharing with world.
I am interested to use your given Login DB, if you allow me for that.
Thanks
Hi, Thanks for your support and for the link. I looked into that and in fact, its very professional development. I would love to use this your login DB within my system, if you allowed me.
After using yours Login DB, do we need to create the, i dont think so.Public strCurrentUser as String
This is already a part of your given DB's login formPrivate Sub cmdLogin_Click()strCurrentUser=Me.txtUserName
End Sub
I used this but having error of enteredby cant be zero length string.
Private Sub Form_BeforeUpdate(Cancel As Integer)
UpdatedBy = GetCurrentUser
UpdatedOn = Now()
End Sub
You are welcome to use any of my free example databases or parts of them. All I ask is that you acknowledge the source of the code.
Not sure i understand your error. Sounds like you're combining my code with your own and the two aren't communicating.
Well, You are right and really its a great support to juniors and we would stand to donate for such wonderful forums.
No, now i will use only yours login DB. if i am using yours then what should be next step to get the enteredby and updateby info about the user.
Kindly advise.
Once users have logged in, you shouldn't get zero length strings or null values for strCurrentUser.
You want to use that value for populating the EnteredBy & UpdatedBy fields in a table.
So on your form(s), just set those fields equal to GetCurrentUser after changes have been made.
e.g. using an after update event
The before update event is used for validation - don't use it for populating those fields
For a new record Me.EnteredBy=GetCurrentUser
For an updated record Me.UpdatedBy=GetCurrentUser
Or if you are using queries/ SQL statements to enter/update records, just include as a field in that code
You mentioned donations. That is of course voluntary but would of course be very welcome![]()
Hi,
Thanks for the advises and explanation.
I am not getting anywhere.
Can you provide the solution according to your login DB which is being used by me now as well.
I will appreciate your help.
*This is off course, and we as junior should do so as we a learning a lot from our seniors.
Hi, Thanks
I enclosed the DB and "FrmProcessA_Head" has the requirements of user name for both events of enteredby and updateby.
One more question related to your login db solution.
How user would logout after finished his task?
I added a App exit button t a form to close the app after job is done but still it showed the user is logged in.
kindly advise for this case too.
In Form frmProcessA_Head I changed the code in the Form_AfterUpdate & Form_Current events to use GetUserName instead of Environ("UserName")
You will see 2 entries in that table - one for cridd (my network username) and one for delilah wh I logged in as
If you look at frmSessions, there is a LogMeOut button. This includes the following 2 lines of code to close the session for this user and flag them as logged out.
So all you need to do is add the same code to a button that exits the database or to a form close event that does the same thingCode:Call CloseSession Call LogMeOff(lngLoginID)
For example
The line DoEvents is used to ensure the previous code has completed before proceeding. It may not be needed here but won't do any harmCode:Private Sub cmdClose_Click Call CloseSession Call LogMeOff(lngLoginID) DoEvents Application.Quit End Sub
Other changes you need to make:
1. When the Login button is clicked, you need to change the code to open one of your forms e.g. frmProcessA_Head (or a switchboard type form)
2. Your database doesn't compile. I've made no attempt to fix any compilation errors but you need to do so.
Hi
Thanks for the efforts and detailed explanation which makes things clear now.
Yeah i modify accordingly and its showing the real current users now.
Yah, i already created a DashBoard to show up after login form and put a button "CmdLogOut" on it and paste the code on click event as below:
and its logging out in immediately. What if, we want to prompt a message before logging out. Some thing like" Are you sure to log out the system", etc.Private Sub CmdLogOut_Click
Call CloseSession
Call LogMeOff(lngLoginID)
DoEvents
Application.Quit
End Sub
To add a message, then do something like this
Code:Private Sub CmdLogOut_Click If MsgBox("This will log you out and close the application" & vbCrLf & _ "Are you SURE you want to do this?, vbQuestion+vbYesNo+vbDefaultButton2,"Logout & Quit?")= vbNo Then Exit Sub Call CloseSession Call LogMeOff(lngLoginID) DoEvents Application.Quit End Sub
Hi
Thanks for the efforts and its working fantastic so far.
Since you have the DB copy already and review of it.
There is one pending thread related to that DB copy.
I will appreciate if you can have a look around for any positive solution.
https://www.accessforums.net/showthread.php?t=74097
I did look at that thread briefly but as WIP meant nothing to me & others had replied I left it alone
Sorry but I haven't got time to study it now
However, in the last post in that thread you wrote
That suggests you may want to use cascading comboboxes.At Process_C: At the start of the shift via Form "FrmProcessC_Head, The Operator should be able to select the product List available in Process_B (Off course Produced by Process_A) via form "FrmProcessC_Tail". Once he select the Product then only related DCars should be shown in the selection list of "DCars No" at form "FrmProcessC_Tail1".
Have a look at this example and see if it helps: http://www.mendipdatasystems.co.uk/c...xes/4594455723