Absolutely incredible. Thank you so much for the tutorial! I'm an Access newbie and was able to follow along just fine! Also - thank you to the previous commentors as well! I was able to solve a few hiccups I encountered by reading through similar experiences.
Austin, your coded an excellent functional example and explained it very well. Thanks for saving me so much time and teaching me so much by showing how it's done!
at around the 3:00 area you're talking about network login versus this access login form. My users will be accesing the database from their own computers, but I need to track changes which is why I am using a login form. my idea is to store the login ID and information in a global variable and on load for every form it will run a check to see if that global is True otherwise prevent it from opening in order to secure data entry, and also to have a field in all tables that references the user who added the data. But you seemed to imply that this was not necesssary. Is there another way for me to ensure and track changes like this?
if your users have their own LoginID and Password for a network computer then you dont have to use the Login Form. Login form is used for many users share the computer login ID. Use Environ function to get the network loginID. More info at ruclips.net/video/nWgLaehaqnc/видео.html
hi, i'm having a trouble regarding this code If UserLevel = 1 Then 'for admin DoCmd.OpenForm "Navigation Form" Forms![Navigation Form]![txtuser] = TempLoginID Else DoCmd.OpenForm "Navigation Form" Forms![Navigation Form]![txtuser] = TempLoginID Forms![Navigation Form]!NavigationButtonAdmin.Enabled = False End If why it does the opposite action? (when i enter the admin id and password, it disable the admin button on navigation bar while the regular user can click the admin button)
you may add this code under the UserLevel =1 Forms![Navigation Form]!NavigationButtonAdmin.Enabled = True Also please make sure your User level set to Admin
Austin, great tutorial. I followed your video to this far but I got stuck at this error. "Run-time error '438' Object doesn't support this property or method" when I enter the userID and password. The txtLogin showed the loginID in the "Navigation Form" but the Label (txtUser from your video) could not show the UserName. The code highlighted was Forms![frmNavigation]![Label] = UserName (where UserName = DLookup("[UserName]", "tblUsers", "[UserLogin] = '" & me.txtLoginID.value * "'")) I need help. Also, how do you set the default "UserType" or "UserSecurity" to only show User? Thanks
Hey great video I am trying to apply your principles in my database but when I login in it doesn’t load the information for the person logged, instead it shows the first data. Hope to get your reply Thank you
I want to lock down access to my database. I want to have access to everything (F11 Navigation Pane, tables, queries, modules and macros, and VBA code). I want all other users to only be able to go where my forms allow them to go. I don't want them to be able to open the F11 Navigation Pane, and I don't want them to have access to any tables, queries, modules and macros, or VBA code. I also don't want them to have access to the Design View or Layout View of my forms... I only want them to have access to the Form View and to be able to do what my forms allow them to do (add new records, search and edit others). I also don't want them to have access to the ribbon at the top of the screen. Is this possible?
Thanks for responding to my question on Part 1 Austin. However, instead of inputting login information I would like to filter the main form to the record that belongs to the user that logged in. Is this possible? Thanks
hi austin72406 im having a trouble regarding on this code Forms![Navigation form]!NavigationButton13.enable = False run-time error '438' object doesn't support this property or method
Dear Sir, how to create my labour time sheet in access database including in time, out time with over time our as per calculation. Please provide link for know about data programmes. Thanks,
you can just a table of employee and log time. under the Log time you have field name like employeeID, time stamps for Time In and Stamp for Time Out. subtract Time in from Time Out then you will get how many hour pay day. You can find over time from working more than 8 hours per day.
Dear Austin, thanks for this great tutorial. I have a query about this login form code . Which is the code function that validating the loginID and its unique password? There must be a function which is missing - Temploginid = me.textusername.value Tempass= dlookup("password", tblworkers, "loginid = '" & me.textusername.value & "' ") If tempass = me.txtpassword.value then Process job else Cancel job Endif Please advise if i am wrong. Currently itseems any password from tblworkers can process the job with any loginid from tblworkers. Appreciate ur reply. Thank you again
I'm confused which table you are using for the logins. The worker table or the user table? On video 1,2,3 you were running it from the user table so should I make a worker table as well for the video 4? Excellent tutorials though!
Hi Austin, I am getting Run-time error '438' Object doesn't support this property or method. when i am using below command to disable button on form. Forms![Navigation Form]!NavigationButton13.enable = False
austin72406 i'm having the same Run-time error '438' Object doesn't support this property or method when i'm trying to disable the NavigationButton13 . I have the correct code written 'Forms![Navigation form]!NavigationButton13.Enabled = False' . however the codes 'Forms![Navigation Form]![txtLogin] = TempLoginID' and 'Forms![Navigation Form]![txtUser] = workerName' work just fine. any assistance will be greatly appreciated. thanks in advance.
Hi! I m new to VBA and i need some help! I would like to have a table where i can save all the user names that log in into my database. How can i do that? Thanks!
Hi! Great work! I followed all the steps and everything works fine except one annoying thing, when I login into the Navigation Form, the fullname and loginID in the Home Form does not load unless I click on the home tab. How can the Home Form load automatically as soon as I login into the Navigation Form (I dont want to click on the Home tab all the time when I start to see the Name pop out). Thanks a lot, keep up the good work!
Nice tutorial. Thanks for that. But I think there must be something strongly wrong in your code. Every user can login to the database if they use one of the existing passwords from another user. That cannot be correct is it?
+austin72406This problem was actually not corrected as of the last display of coding in the 4th video of your 4 part series.+Edwin Izelaar, +Isoke PerrtIn the video, the following lines are where the error exists:If (IsNull(DLookup("LoginID", "tblworker", "LoginID = '" & Me.txtUserName.Value & "'"))) Or _ (IsNull(DLookup("Password", "tblworker", "password = '" & Me.txtPassword.Value & "'"))) ThenThe checking for Null is redundant because you've already verified values exist in both the txtUserName and txtPassword fields. Additionally, the use of .value is unnecessary and may create additional problems for users whose passwords are not strictly numeric.As stated, this code allows any combination of any username with any user password to allow entry. For some users, that may not be that much of a concern. For others, this is a serious failure as an employee may be able to use their managers username with their own password and thus allow entry into something they shouldn't have. This code is actually saying, as long as neither of these returns null (meaning both values were located somewhere in the table, not necessarily matching on the same record) then continue.Replace the lines mentioned above with this:If Not DLookup("Password", "tblworker", "LoginID = '" & Me.txtUserName & "'") = Me.txtPassword Then This will REQUIRE BOTH Username AND Password MATCH, though it will require unique Usernames. If you use just first names as your username, then John Smith and John Deer would both have a username of John; in which case the Dlookup only returns the first match located, meaning the 2nd John entered into the table would never get in.The addition of "Not" (beginning with "If Not") changes a True value to False and False value to True. This is done because the rest of the code in the If/Then/Else is setup backwards. It was setup backwards because the previous code was only failing (or returning false) if the values entered where not found in the table.The Dlookup function returns a value, like this: Dlookup("The Field Name I Want Returned", "From This Table Name", "Where This or These Conditions Are True or Match"The original code was returning the same field as it was checking. In the correction, we return the password for the username then compare it to what was provided by the user; thus ensuring an actual MATCH.
Hi Teewan, Great tutorial! I am having a bit of a problem with mine. Admin is UserSecurity = 1. I'd like NavigationButton29 enabled for Admin only. But NavigationButton29 is showing disabled for everyone including Admin. Thanks again for your help! My code shows: Private Sub Command1_Click() Dim UserLevel As Integer If IsNull(Me.txtLoginID) Then MsgBox "Please enter Login ID", vbInformation, "Login ID Required" Me.txtLoginID.SetFocus ElseIf IsNull(Me.txtPassword) Then MsgBox "Please enter Password", vbInformation, "Password Required" Me.txtPassword.SetFocus Else 'process the job If (IsNull(DLookup("[UserLogin]", "UsersT", "[Userlogin] ='" & Me.txtLoginID.Value & "' And password = '" & Me.txtPassword.Value & "'"))) Then MsgBox "Incorrect Login ID or Password" Else UserLevel = DLookup("UserSecurity", "UsersT", "UserLogin = '" & Me.txtLoginID.Value & "'") DoCmd.Close If UserSecurity = 1 Then DoCmd.OpenForm "MainF" Else DoCmd.OpenForm "MainF" Forms![MainF]!NavigationButton29.Enabled = False End If End If End If End Sub
update with this: If UserSecurity = 1 Then DoCmd.OpenForm "MainF" Forms![MainF]!NavigationButton29.Enabled = True Else DoCmd.OpenForm "MainF" Forms![MainF]!NavigationButton29.Enabled = False End If
hi Tewan thanks again for your upload,. My friend sister is studying as Programmer I suggested your videos to her as a reference,. She has a question on me but I can't really figure it out too,. Her Question is in this video at 12:29 How can she use your Example from Video 8 in your playlist titled "Function Greeting User on Open" together with this,. I guest she is really trying to figure out how all your examples work thank you,.
you need a textbox names TxtLogin on the navigation form then set Me.User = Forms![navigation form]!TxtLogin instead of =Environ("username") on your greeting pagesee full instruction on @create-login-form-ms-access/good luck
austin72406 thanks for your quick respond Tewan,. She has find a way,. I also try but i have a different problem using the code it always respond "You are not a member! You will be logged as Guest." even if Me,User is showing the UserName,. its as if Dlookup is not working,.
austin72406 Tewan is there a way? for Example theres a record then if I click the link its show a certain Form but the PAGE on a TAB won't show-up base on the UserName or Security Level,.
yes, there is a way. if you open a navigation form with tab (page) then you can use "Forms![navigation form]!NavigationButton13.Enabled = False" (or .visible = false) on the click button to open the navigation form.
Hi Austin,,How to set the size of Navigation Control (The Main Menu/Page), when user got log in, there is an excess or space, that I want to minimize when user got log in. thank you so much!
hello sir, can you help me with the problem? when i login with different user with the securitylevel is admin, then the user cannot access the admin page because it follows the security level of the first record, can you help me how to solve this problem? thank you very much...
ok sir i already solve the problem but whenever i login to the navigation form with a different user name, the table login time record the name of my laptop and not the name of the user, is it because of environ("username") or have to add other codes, i appreciate your help, thank u...
Hi Austin,,I'm having an error on this code,Please help me, thank you...UserLevel = DLookup("UserSecurity","tblUser","UserLogin = '" & Me.txtUserLogin.Value & "'")
Fantastic tutorial for a novice like me. But I am having an error with the If else statement in part 1 of your tutorial. It says compile error with password. If (Isnull(Dlookup ("User Login" , "TBL_User", "User Login ="", &me.txtLoginID.value& ""))) OR_(Isnull(Dlookup ("Password", "TBL_User", "Password ="", &me.txtPassword.value& "")))Then Need help on this Thanks
Access database error message "not a valid bookmark " plzzzz solve this very important I am working with visual basic.net 2012 and database in ms access
Dear Sir firstly i am saying thanks for this tutorial. i have face a problem on this login project.when i login with user name and different password on the tbl_user it's process the job.how to solve this pls comment.
Use AND Operator between userID and Password example: If (IsNull(DLookup("[UserLogin]", "tblUser", "[Userlogin] ='" & Me.txtLoginID.Value & "' And password = '" & Me.txtPassword.Value & "'"))) Then msgbox "............" else ...... end if
If (IsNull(DLookup("UserLogin", "tblUser", "Userlogin ='" & Me.txtLoginID.Value & "" And "Password ='" & Me.txtpassword.Value & ""))) Then MsgBox "Incorrect LoginId or Password" it does not work for me
Excellent tutorial! Everything works great except after the new users change their passwords from "password". They can log in using "password". My code is below. Any help would be appreciated. Not sure what I'm missing here. Thanks. Dim UserLevel As Integer Dim TempPassword As String Dim ID As Integer Dim Username As String Dim TempLoginID As String If IsNull(Me.txtLoginID) Then MsgBox "Please enter Username", vbInformation, "Username Required" Me.txtLoginID.SetFocus ElseIf IsNull(Me.txtPassword) Then MsgBox "Please enter Password", vbInformation, "Password Required" Me.txtPassword.SetFocus Else ' Validation of username and password If (IsNull(DLookup("UserLogin", "Tbl_User", "UserLogin = '" & Me.txtLoginID.Value & "'"))) Or _ (IsNull(DLookup("Password", "Tbl_User", "Password = '" & Me.txtPassword.Value & "'"))) Then MsgBox "Invalid Username or Password!", vbCritical, "Login Error" 'If User Enters incorrect password 3 times database will shutdown intLogonAttempts = intLogonAttempts + 1 If intLogonAttempts > 3 Then MsgBox "You do not have access to this database. Please contact Admin.", _ vbCritical, "Restricted Access!" Application.Quit End If ' First time users can change password Else TempLoginID = Me.txtLoginID.Value Username = DLookup("[Username]", "Tbl_User", "[UserLogin] = '" & Me.txtLoginID.Value & "'") UserLevel = DLookup("[UserType]", "Tbl_User", "[UserLogin] = '" & Me.txtLoginID.Value & "'") TempPassword = DLookup("[Password]", "Tbl_User", "[UserLogin] = '" & Me.txtLoginID.Value & "'") ID = DLookup("[UserID]", "Tbl_User", "[UserLogin] = '" & Me.txtLoginID.Value & "'") DoCmd.Close If (TempPassword = "password") Then MsgBox "Please change password.", vbInformation, "New password required" DoCmd.OpenForm "Frm_ChangePassword", , , "[UserID] = " & ID Else If UserLevel = 1 Then ' For admin level DoCmd.OpenForm "Frm_Navigation" Forms![Frm_Navigation]![txtLogin] = TempLoginID Forms![Frm_Navigation]![txtUser] = Username Else ' For user level DoCmd.OpenForm "Frm_Navigation_RO" Forms![Frm_Navigation_RO]![txtLogin] = TempLoginID Forms![Frm_Navigation_RO]![txtUser] = Username End If End If End If End If End Sub
I never figured out how to change the temp password from working. What I did was assign different temp passwords to new users then change the temp password after they changed their password. I would only know the new temp password.
Absolutely incredible. Thank you so much for the tutorial! I'm an Access newbie and was able to follow along just fine!
Also - thank you to the previous commentors as well! I was able to solve a few hiccups I encountered by reading through similar experiences.
Austin, your coded an excellent functional example and explained it very well. Thanks for saving me so much time and teaching me so much by showing how it's done!
Thank you for this series, I was able to create a user log in form complete with password change functionality.
Excellent, dear
N K from India
Amazing & absolutely incredible thank u teacher. ...
Thanks for the great tutorials. Kindly put a step by step video on how to do the home page
at around the 3:00 area you're talking about network login versus this access login form. My users will be accesing the database from their own computers, but I need to track changes which is why I am using a login form. my idea is to store the login ID and information in a global variable and on load for every form it will run a check to see if that global is True otherwise prevent it from opening in order to secure data entry, and also to have a field in all tables that references the user who added the data.
But you seemed to imply that this was not necesssary. Is there another way for me to ensure and track changes like this?
if your users have their own LoginID and Password for a network computer then you dont have to use the Login Form. Login form is used for many users share the computer login ID. Use Environ function to get the network loginID. More info at ruclips.net/video/nWgLaehaqnc/видео.html
Thank you for the Tutorial, very informative. I wish to learn more.
Compliment from Italy for your great tutorial
They are very usefull
Thanks
hi, i'm having a trouble regarding this code
If UserLevel = 1 Then 'for admin
DoCmd.OpenForm "Navigation Form"
Forms![Navigation Form]![txtuser] = TempLoginID
Else
DoCmd.OpenForm "Navigation Form"
Forms![Navigation Form]![txtuser] = TempLoginID
Forms![Navigation Form]!NavigationButtonAdmin.Enabled = False
End If
why it does the opposite action? (when i enter the admin id and password, it disable the admin button on navigation bar while the regular user can click the admin button)
you may add this code under the UserLevel =1
Forms![Navigation Form]!NavigationButtonAdmin.Enabled = True
Also please make sure your User level set to Admin
Austin, great tutorial. I followed your video to this far but I got stuck at this error. "Run-time error '438' Object doesn't support this property or method" when I enter the userID and password. The txtLogin showed the loginID in the "Navigation Form" but the Label (txtUser from your video) could not show the UserName. The code highlighted was Forms![frmNavigation]![Label] = UserName (where UserName = DLookup("[UserName]", "tblUsers", "[UserLogin] = '" & me.txtLoginID.value * "'")) I need help.
Also, how do you set the default "UserType" or "UserSecurity" to only show User? Thanks
Hey great video
I am trying to apply your principles in my database but when I login in it doesn’t load the information for the person logged, instead it shows the first data.
Hope to get your reply
Thank you
I want to lock down access to my database.
I want to have access to everything (F11 Navigation Pane, tables, queries, modules and macros, and VBA code).
I want all other users to only be able to go where my forms allow them to go. I don't want them to be able to open the F11 Navigation Pane, and I don't want them to have access to any tables, queries, modules and macros, or VBA code. I also don't want them to have access to the Design View or Layout View of my forms... I only want them to have access to the Form View and to be able to do what my forms allow them to do (add new records, search and edit others). I also don't want them to have access to the ribbon at the top of the screen.
Is this possible?
watch this video: Hide database window, Hide menu, Disable shortcut menu, Disable Special Keys : MS Access
Thanks for responding to my question on Part 1 Austin. However, instead of inputting login information I would like to filter the main form to the record that belongs to the user that logged in. Is this possible? Thanks
It look similar to another video: Show record only related to User log in link: @ppGYIZwpHhU
Is there a way to add more levels than just Admin and user? I'd like to add different levels for each department in my office.
Thank you! You saved me SO MUCH TIME. THANK YOU THANK YOU.
Thank you so much for this GREAT tutorial!!!!
hi austin72406 im having a trouble regarding on this code
Forms![Navigation form]!NavigationButton13.enable = False
run-time error '438'
object doesn't support this property or method
it's typo. the correct should be .Enabled = False
thanks., your'e a such big help.
Dear Sir, how to create my labour time sheet in access database including in time, out time with over time our as per calculation. Please provide link for know about data programmes.
Thanks,
you can just a table of employee and log time. under the Log time you have field name like employeeID, time stamps for Time In and Stamp for Time Out. subtract Time in from Time Out then you will get how many hour pay day. You can find over time from working more than 8 hours per day.
Thanks sir for making contact and suggestion
Dear Austin, thanks for this great tutorial. I have a query about this login form code . Which is the code function that validating the loginID and its unique password?
There must be a function which is missing -
Temploginid = me.textusername.value
Tempass= dlookup("password", tblworkers, "loginid = '" & me.textusername.value & "' ")
If tempass = me.txtpassword.value then
Process job else
Cancel job
Endif
Please advise if i am wrong. Currently itseems any password from tblworkers can process the job with any loginid from tblworkers.
Appreciate ur reply. Thank you again
you will need to Lookup for a UserID (like 1, 2 5 , 8) on User table or worker table where LoginID = me.textUserName and Password = me.txtpassword
This fourth video messed everything up. Especially for newbies. I hope you could upload a revised Fourth Video?
I'm confused which table you are using for the logins. The worker table or the user table? On video 1,2,3 you were running it from the user table so should I make a worker table as well for the video 4? Excellent tutorials though!
I have two files with different table name. You can use either user table or worker table. just update the field name and table name.
Ok Thanks! Watching all your access database videos, there brilliant!
Hi Austin,
I am getting Run-time error '438' Object doesn't support this property or method.
when i am using below command to disable button on form.
Forms![Navigation Form]!NavigationButton13.enable = False
do you use Access 2010?
i use access 2007-2010
you have it missed spell on above code. The correct code should be: Forms![Navigation form]!NavigationButton13.Enabled = False
austin72406
i'm having the same Run-time error '438' Object doesn't support this property or method when i'm trying to disable the NavigationButton13 . I have the correct code written 'Forms![Navigation form]!NavigationButton13.Enabled = False' . however the codes 'Forms![Navigation Form]![txtLogin] = TempLoginID' and
'Forms![Navigation Form]![txtUser] = workerName' work just fine. any assistance will be greatly appreciated. thanks in advance.
Hi!
I m new to VBA and i need some help! I would like to have a table where i can save all the user names that log in into my database. How can i do that?
Thanks!
watch this video on how to track User log in database ruclips.net/video/p42uH-0Fh5g/видео.html
Hi! Great work! I followed all the steps and everything works fine except one annoying thing, when I login into the Navigation Form, the fullname and loginID in the Home Form does not load unless I click on the home tab. How can the Home Form load automatically as soon as I login into the Navigation Form (I dont want to click on the Home tab all the time when I start to see the Name pop out). Thanks a lot, keep up the good work!
do you have a video on how to make tabs in tabs as it is at 12:07. i would like to do that. Can you make a video on how or do you have one already?
Nice tutorial. Thanks for that. But I think there must be something strongly wrong in your code. Every user can login to the database if they use one of the existing passwords from another user. That cannot be correct is it?
it was corrected in part 3 or 4
+Edwin Izelaar, did you ever get it corrected? im now stuck with the same issue.... :(
No unfortunately not
+austin72406This problem was actually not corrected as of the last display of coding in the 4th video of your 4 part series.+Edwin Izelaar, +Isoke PerrtIn the video, the following lines are where the error exists:If (IsNull(DLookup("LoginID", "tblworker", "LoginID = '" & Me.txtUserName.Value & "'"))) Or _
(IsNull(DLookup("Password", "tblworker", "password = '" & Me.txtPassword.Value & "'"))) ThenThe checking for Null is redundant because you've already verified values exist in both the txtUserName and txtPassword fields. Additionally, the use of .value is unnecessary and may create additional problems for users whose passwords are not strictly numeric.As stated, this code allows any combination of any username with any user password to allow entry. For some users, that may not be that much of a concern. For others, this is a serious failure as an employee may be able to use their managers username with their own password and thus allow entry into something they shouldn't have. This code is actually saying, as long as neither of these returns null (meaning both values were located somewhere in the table, not necessarily matching on the same record) then continue.Replace the lines mentioned above with this:If Not DLookup("Password", "tblworker", "LoginID = '" & Me.txtUserName & "'") = Me.txtPassword Then
This will REQUIRE BOTH Username AND Password MATCH, though it will require unique Usernames. If you use just first names as your username, then John Smith and John Deer would both have a username of John; in which case the Dlookup only returns the first match located, meaning the 2nd John entered into the table would never get in.The addition of "Not" (beginning with "If Not") changes a True value to False and False value to True. This is done because the rest of the code in the If/Then/Else is setup backwards. It was setup backwards because the previous code was only failing (or returning false) if the values entered where not found in the table.The Dlookup function returns a value, like this: Dlookup("The Field Name I Want Returned", "From This Table Name", "Where This or These Conditions Are True or Match"The original code was returning the same field as it was checking. In the correction, we return the password for the username then compare it to what was provided by the user; thus ensuring an actual MATCH.
@@mikehill3520 Thanks for this. I had not noticed that error. Fixed now!
Creating the worker table is confusing.it would have been better if you kept depending on user tabe
Hi Teewan, Great tutorial!
I am having a bit of a problem with mine. Admin is UserSecurity = 1. I'd like NavigationButton29 enabled for Admin only.
But NavigationButton29 is showing disabled for everyone including Admin.
Thanks again for your help!
My code shows:
Private Sub Command1_Click()
Dim UserLevel As Integer
If IsNull(Me.txtLoginID) Then
MsgBox "Please enter Login ID", vbInformation, "Login ID Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please enter Password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
'process the job
If (IsNull(DLookup("[UserLogin]", "UsersT", "[Userlogin] ='" & Me.txtLoginID.Value & "' And password = '" & Me.txtPassword.Value & "'"))) Then
MsgBox "Incorrect Login ID or Password"
Else
UserLevel = DLookup("UserSecurity", "UsersT", "UserLogin = '" & Me.txtLoginID.Value & "'")
DoCmd.Close
If UserSecurity = 1 Then
DoCmd.OpenForm "MainF"
Else
DoCmd.OpenForm "MainF"
Forms![MainF]!NavigationButton29.Enabled = False
End If
End If
End If
End Sub
update with this: If UserSecurity = 1 Then
DoCmd.OpenForm "MainF" Forms![MainF]!NavigationButton29.Enabled = True
Else
DoCmd.OpenForm "MainF"
Forms![MainF]!NavigationButton29.Enabled = False
End If
hi Tewan thanks again for your upload,. My friend sister is studying as Programmer I suggested your videos to her as a reference,. She has a question on me but I can't really figure it out too,. Her Question is in this video at 12:29 How can she use your Example from Video 8 in your playlist titled "Function Greeting User on Open" together with this,. I guest she is really trying to figure out how all your examples work thank you,.
you need a textbox names TxtLogin on the navigation form then set Me.User = Forms![navigation form]!TxtLogin instead of =Environ("username") on your greeting pagesee full instruction on @create-login-form-ms-access/good luck
austin72406 thanks for your quick respond Tewan,. She has find a way,. I also try but i have a different problem using the code it always respond "You are not a member! You will be logged as Guest." even if Me,User is showing the UserName,. its as if Dlookup is not working,.
austin72406 Tewan is there a way? for Example theres a record then if I click the link its show a certain Form but the PAGE on a TAB won't show-up base on the UserName or Security Level,.
make sure to you have a correct field name, table name on Dlookup matching with your username table. you can revise the code on your greeting page.
yes, there is a way. if you open a navigation form with tab (page) then you can use "Forms![navigation form]!NavigationButton13.Enabled = False" (or .visible = false) on the click button to open the navigation form.
Hi Austin,,How to set the size of Navigation Control (The Main Menu/Page), when user got log in, there is an excess or space, that I want to minimize when user got log in. thank you so much!
did you mean the Ribbon Menu bar?
Hello
Please tell how can I create a login form with a photo? .....
That is, a photo of the user in main form.
thanks
hello sir, can you help me with the problem? when i login with different user with the securitylevel is admin, then the user cannot access the admin page because it follows the security level of the first record, can you help me how to solve this problem? thank you very much...
you can use Dlook to find the security level of user login that links to the current login user.
ok sir i already solve the problem but whenever i login to the navigation form with a different user name, the table login time record the name of my laptop and not the name of the user, is it because of environ("username") or have to add other codes, i appreciate your help, thank u...
Hi Austin,,I'm having an error on this code,Please help me, thank you...UserLevel = DLookup("UserSecurity","tblUser","UserLogin = '" & Me.txtUserLogin.Value & "'")
please make sure that if UserSecurity field has data type as integer or number then UserLevel must set to integer like
Dim UserLevel as integer
Fantastic tutorial for a novice like me. But I am having an error with the If else statement in part 1 of your tutorial. It says compile error with password.
If (Isnull(Dlookup ("User Login" , "TBL_User", "User Login ="", &me.txtLoginID.value& ""))) OR_(Isnull(Dlookup ("Password", "TBL_User", "Password ="", &me.txtPassword.value& "")))Then
Need help on this
Thanks
The code was revised on part 4
Thanks will check that out.
Access database error message "not a valid bookmark " plzzzz solve this very important I am working with visual basic.net 2012 and database in ms access
"please change Password. pop msg cant open & i cannot open password reset form
thank you verymuch for knowledge
you're welcome
Dear Sir
firstly i am saying thanks for this tutorial. i have face a problem on this login project.when i login with user name and different password on the tbl_user it's process the job.how to solve this pls comment.
Use AND Operator between userID and Password
example:
If (IsNull(DLookup("[UserLogin]", "tblUser", "[Userlogin] ='" & Me.txtLoginID.Value & "' And password = '" & Me.txtPassword.Value & "'"))) Then
msgbox "............"
else
......
end if
If (IsNull(DLookup("UserLogin", "tblUser", "Userlogin ='" & Me.txtLoginID.Value & "" And "Password ='" & Me.txtpassword.Value & ""))) Then
MsgBox "Incorrect LoginId or Password"
it does not work for me
Yes right but I can't stop use Alt + F4 when form Log on. If you know pls help me. Thank you :)
HI Ms austin
How create Home form in navigation form
just create a Home form then put it under the first tab of Navigation form
Hi Ms austin
Can you send me your Email to send you the database of the form Home
created by me
Excellent tutorial!
www.udemy.com Create a Database: Point of Sale(POS) Step-by-step Thnaks for Austin for inter this details
thanks guys
Thanks.
Nice!
good job !
Excellent tutorial! Everything works great except after the new users change their passwords from "password". They can log in using "password". My code is below. Any help would be appreciated. Not sure what I'm missing here. Thanks.
Dim UserLevel As Integer
Dim TempPassword As String
Dim ID As Integer
Dim Username As String
Dim TempLoginID As String
If IsNull(Me.txtLoginID) Then
MsgBox "Please enter Username", vbInformation, "Username Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please enter Password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
' Validation of username and password
If (IsNull(DLookup("UserLogin", "Tbl_User", "UserLogin = '" & Me.txtLoginID.Value & "'"))) Or _
(IsNull(DLookup("Password", "Tbl_User", "Password = '" & Me.txtPassword.Value & "'"))) Then
MsgBox "Invalid Username or Password!", vbCritical, "Login Error"
'If User Enters incorrect password 3 times database will shutdown
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database. Please contact Admin.", _
vbCritical, "Restricted Access!"
Application.Quit
End If
' First time users can change password
Else
TempLoginID = Me.txtLoginID.Value
Username = DLookup("[Username]", "Tbl_User", "[UserLogin] = '" & Me.txtLoginID.Value & "'")
UserLevel = DLookup("[UserType]", "Tbl_User", "[UserLogin] = '" & Me.txtLoginID.Value & "'")
TempPassword = DLookup("[Password]", "Tbl_User", "[UserLogin] = '" & Me.txtLoginID.Value & "'")
ID = DLookup("[UserID]", "Tbl_User", "[UserLogin] = '" & Me.txtLoginID.Value & "'")
DoCmd.Close
If (TempPassword = "password") Then
MsgBox "Please change password.", vbInformation, "New password required"
DoCmd.OpenForm "Frm_ChangePassword", , , "[UserID] = " & ID
Else
If UserLevel = 1 Then ' For admin level
DoCmd.OpenForm "Frm_Navigation"
Forms![Frm_Navigation]![txtLogin] = TempLoginID
Forms![Frm_Navigation]![txtUser] = Username
Else ' For user level
DoCmd.OpenForm "Frm_Navigation_RO"
Forms![Frm_Navigation_RO]![txtLogin] = TempLoginID
Forms![Frm_Navigation_RO]![txtUser] = Username
End If
End If
End If
End If
End Sub
I never figured out how to change the temp password from working. What I did was assign different temp passwords to new users then change the temp password after they changed their password. I would only know the new temp password.