Thanks Allan, I hope its gonna work but I will let you know if I had any problems.
Printable View
Thanks Allan, I hope its gonna work but I will let you know if I had any problems.
Hi Allan,
Thanks for this Login example, its just what I was looking for!
Just a quick question, I am wanting to display the logged in user name on a form so it acts as a signiture, how do I display this.
Once again thanks,
m@rk
Hello m@rk
That you for your comments.
By forms do you mean the screen or a form printed as a report.
About message 43 on this forum gives details regarding displaying and using the user id. Here is a snippet from that message
The frm_utility is open and hidden when the user logs in, the user id is stored on the form. So to use it on the screen or in a report you make reference to the user id as aboveQuote:
'store the user id on the utility form frm_utility
Forms!frm_utility!user_id = Forms!frm_main!user_id
When you want to stamp a process with the user's id you woulduse something like this user_id=forms!frm_utility!user_id
Hi Allan,
Thanks for your reply, I hav tried making a reference to the user id (by copying the text box) from the frm_utility but it still doesnt seem to work?
I basically want to display the name of the person logged in and then populate a form field as a sort of digital signature. (currently the task is done on paper and then signed off)
Can you offer any further help / example on doing this?
Thanks,
Mark.
Hello Mark
On your form or report add a text box and set the record source to =forms!frm_utility!user_id
Regards
Hi Allan,
I am so newbie one. I also need your login that don't need level.
Please kindly help to forward to me on [email protected]
Thanks in advance
Have a look at message 44 on this thread. Do not use the code that determines the access level.
The login validates the user ID and password, check sfor expiry date of the password. Then opens a switchboard depending on the user's access level.
If you have problems with the please post your attempt to this thread.
Allan, I have tried to follow other's examples of login screens and always something was left out or not explained. I really appreciate you helping us here. I have downloaded the example in #10 and opened it in Access 2003 and it works just fine. When I import it into Acess 2010, it stops with the error message: Object doesn't support this property or method. Can you tell me what I need to change to make it work. Thanks.
Sherry
Thank you for your comments. This is my way of thanking other people who posted various solutions that helped me over the years.
Your problem maybe due to not having a reference set in Access 2010. At the moment I am using Access 2007 not Access 2010.
I have attached a screen shot of the references required for Access 2007 there maybe similar references for 2010. I have also included a zip copy of a newer version of the #10 this new version is located at #43 from memory. I may have made some minor changes to this version.
When I install Access 2010 I will update this thread.
Sherry and all previous viewers
Here is the login version in Acccess 2010 format.
Yes I would like a copy of your login demo. I am having trouble creating one.
email me at meds22cathy.co.uk.
Thanks Cathrine.
Cathrine
Have a look at message 44 on this thread.
Cathrine
Your email address is invalid.
I have a question I have this login form which is really good but I want to add a Dlookup in it to pull certain information from the querys when you log into it I also a login that does this but I like this login better
if anyone can help I will email this database login to you
[email protected]
i have an interesting question.....so with this login security, i have a form with a quiz on it can i have them login like normal but only on certain occasions give them access the the link that goes to the quiz form? like for instance the admin guy has sec. lvl 1 and everyone else has lvl 2.....but can i set the sec. lvl for the quiz to say 3, and then say dec. or jan. add that lvl of sec. to the users so they can access it? i hope i didnt lose anyone...thanks
John
Yes, The access level for each user can be changed anytime by the administrator of the database by using the Add/Edit users menu item which open frm_users.
Alternatively, you could add the Quiz as a menu item to security level2 that would open the quiz, then go into the table that is used to display the menu for security level 2 in the demo version this is switchboard_lev2 make a note of the value in SwitchboardID for the quiz menu item and store in the description field (this will be used later as required). Now go back to the SwitchboardID for the quiz menu and change the existing value to 999.
By changing the value to 999 the user will not have the quiz menu item displayed as most likely you will not have a menu page number(SwitchboardID) with a value of 999-in your current database. when you want to display the quiz change the SwitchboardID 999 to the previous value you stored in the description field. Have I lost you?
The alternative method will be more efficient than trying to change the access level for each user.
Hello Allan, first of all - this thread is great. :)
I'm trying to make DB with simple user login form and afterwards I want to apply user stamp ID on all data that is modified or created in other form. I was using your template with utility form, but I constantly ran into problems.
This is the code part:
DoCmd.OpenForm "UtilityF", , , , , acHidden
Forms!UtilityF!EmpID = Forms!LogInF!EmpID
LogInF - Login form
UtilityF - Utility form
EmpID - Employe ID, AutoNumber in User table
What I get as error message is Runtime error '2448' : "You can't assign a value to this object."
Since I'm VB/Access newbie, can you please tell me what could be the problem?
Hello Storvagun
Please send me a copy of your database with just the login and utility forms and I will have a look at your problem.
Is there any way where we can use windows authentication to login the form.
__________________________________________________ _______________________________________________
Dear Allan,
have created a back end access sheet which is linked to access user form. but the location is different for both.
i have used have used the path to define location for backend form. is there any way where can i use you form to save credential in my backend and users can validate their credential from there. Kindly assist.
If you want a form to manage you user credentials, then just create a form as per your requirements and then set the record source to the tbl_users in your backend database. For security reasons be careful not to allow everyone have access to this form. You will also need password and access level on this form so that you can change the access level and reset the user's password etc.
[QUOTE=sonia;132051]Is there any way where we can use windows authentication to login the form.[/QUOTE
Sure. I do that a lot.
I use this to get the Windows user name: http://access.mvps.org/access/api/api0008.htm
I look up to see if the Windows user is in a local user table. If found then I run the code to log in the user with that user name.
I have not used it, but I have seen way to get more Active Directory (AD) information about the use, like security groups. This would allo you to make a more fully integrated security system using AD.
Hi Allan,
below is code which would like to modify as per my requirement.
my requirement is to save credential in backend database named "tbl_users"
have already created tbl_users. but want to know how to address the table/file through code.
Sub display_menu()
On Error GoTo err_display_menu
' at this stage the userId and access level has been checked
Dim access_level As Integer
Dim finish_Date As Date
Dim port_syd As String
Dim valid_user As Integer
Dim check_user As Integer
Dim password_period As Date
Dim check_password As String
Dim strmsg As String
Dim Connection
Dim Rs1 As ADODB.Recordset
Set Connection = CreateObject("ADODB.Connection")
Set Rs1 = New ADODB.Recordset
Connection.Open (Databasepath)
Rs1.Open "tbl_users", Connection, adOpenDynamic, _
adLockOptimistic, adCmdTableDirect
valid_user = 2
' **********************************************
' validate user_id
' **********************************************
check_user = DCount("[user_id]", "tbl_users", "user_id=forms!frm_main!user_id")
If check_user = 1 Then
valid_user = 2
Else
valid_user = 0
End If
' **********************************************
' validate password
' **********************************************
If valid_user = 2 Then
check_password = DLookup("[passwords]", "tbl_users", "user_id=forms!frm_main!user_id")
If UCase(check_password) = UCase(Forms!frm_main!password) Then
valid_user = 2
Else
valid_user = 1
End If
End If
Sonia
Would you please be more specific in your meaning of "credentials"?
If you mean add a new user to the database then it will be advisable to use a form. The code can be used to add a new user when the user id is not valid. But the question is has a valid user entered an incorrect user id or an incorrect paasword, or an employee has entered an user id in the process of obtaining unauthorised access to the database?
Using a form you are able to control the users who have access to the database.
Allan, user id and password is saved in backed file users have only front end, but his details are saved in backend file.now i want when ever user is entering user id and password it should match from backend file. so have attached both front end and backend, kindly do something so when ever user is entering his user id and password his details should match from the backend file.
the frond end file name is proposal2 and back end file name is Database2.
need your attention on below. i am getting error on below.this code is written for the table which is in the same file. but my table is in split and will send u the file.
check_user = DCount("[user_id]", "tbl_users", "user_id=forms!frm_main!user_id")
Regards,
Sonia
Sonia
I would like to continue this off forum. So would you please supply me with your email address.
Me email address is [email protected]
Dear Allan,
my email id
[email protected].