Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124

    Sign up and Login page

    Hello forum,

    I would like to create some form of authentication for users to access the database.
    I am having trouble with getting people to signup and saving it into employee table.
    Username and password to be saved in login table.
    I know I have to use query to get the data from user in the form.
    I do not know how to do it.

    Please help me.

    Thanks,
    Yours Sincerely,


    Haziq
    Attached Files Attached Files

  2. #2
    baderms is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Aug 2017
    Posts
    8
    What do you mean when you say you are having trouble getting people to signup? Are you trying to require that they signup for access and once granted then they can log in?

  3. #3
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124
    Kinda like that.
    Sign up if they have not.
    When they have already done so their username will be in the combo box.
    They will have to enter the correct password, login page, to enter the main page.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    - When the database opens, set the form to "Main" (or whatever it is called) in the Access options under Current Database
    - have the employees table as the record source of this form
    - in the OnLoad event of this form, get to the employee logging in
    On Error Resume Next
    Me.Filter="LoginID='" & Environ("username") & "'"
    Me.FilterOn=True
    Me.Requery
    If Err <> 0 Then
    DoCmd.GoToRecord,,,acNewRec
    Me!LoginID=Environ("username")
    End If

    - then check the employee's name field to see if it has been entered
    If IsNull(Me!EmplName) Or Me!Emplname="" Then
    ...create a form with PopUp=Yes and Modal=Yes
    ...open this form to allow the user to enter their name

    DO NOT USE PASSWORDS!!! Never.

  5. #5
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    If it's a private network why not just use the Windows Usernames to authenticate the users, they would have to be at there computers and know the windows login that way you can avoid a password field. OnLoad have it check %USERNAME% against a table with all of your known users windows IDs, you can also set up a sign up button and have it echo the username of whomever clicks it to a text document on you file access only obviously or even add it to a waiting approval table, things like that.

  6. #6
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124
    Yes,
    that is exactly right

  7. #7
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124
    Thanks for walking me though this.

    Why never use passwords?

  8. #8
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124
    When you point it out, it makes sense there is no need to create a password field. I am not sure how my department is going to use the database in a pc with only one account or everyone has their own account in the computer.

    Your method is interesting, do you have a video lesson that I can follow through?

    Thanks

  9. #9
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Passwords are dependent on people's memories - the least reliable source of information! They are forgotten all too easily and as you can see, there is no need.

    I am sure you could find a video, or try it yourself and come back with questions.

  10. #10
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    Create Module:
    Code:
    Option Compare Database
    
    Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    
    
    Function UserNameWindows() As String
       
        Dim lngLen As Long
        Dim strBuffer As String
       
        Const dhcMaxUserName = 255
       
        strBuffer = Space(dhcMaxUserName)
        lngLen = dhcMaxUserName
        If CBool(GetUserName(strBuffer, lngLen)) Then
            UserNameWindows = Left$(strBuffer, lngLen - 1)
        Else
            UserNameWindows = ""
        End If
    End Function
    
    
    'Sub test()
    'MsgBox UserNameWindows
    'End Sub
    Call in text box on login screen remove the ability to edit entries with:

    Code:
    =UserNameWindows()
    With this and some googling you should be able to get pretty far, you can also have a 3rd table to log each time a user opens it with a time stamp for "auditing"

    Don't use passwords, anyone with half a brain can find your back end and open the table, and remove any masking you have on text, if you try to protect your back end like with passwords the other users will not be able to access it through the front end, and if you write the access within the code on the front end they can just open your modules and read the passwords.

  11. #11
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124

    That is so true

    True. I have not process the first part you advice me to do.

    I will get coding starting tmr.
    Thx for the codes!

  12. #12
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124

    Get windowsUsername

    Hello,

    I cannot get anything out of what I did.

    Could you see where did I go wrong?

    Please

    Thanks
    Attached Files Attached Files

  13. #13
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133

    Example of Windows Username Login to DB

    Check this out, open the tblUsers, add your pc username (example: admin, user, fname) and a random password in the password field, threw this together real quick for you has modules and call.

    Windowsloginexample.zip

  14. #14
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124
    Thanks.
    I will look at it when I log in to my comp.

  15. #15
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124

    Signup & Login

    Hello Forbes,

    I have taken a look,
    The forms are beautiful.

    That seems to be an error when I open the program. And when I enter my password it says it is incorrect.
    Why is that so?
    Click image for larger version. 

Name:	windowsusername.jpg 
Views:	25 
Size:	94.2 KB 
ID:	30466




    Click image for larger version. 

Name:	frm.jpg 
Views:	25 
Size:	96.2 KB 
ID:	30467

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Login Page
    By netguy in forum Programming
    Replies: 4
    Last Post: 09-30-2014, 03:13 PM
  2. Login Page and Welcome note
    By annliang in forum Forms
    Replies: 3
    Last Post: 01-23-2014, 12:49 AM
  3. Creating Login Page from template
    By sherryb41 in forum Access
    Replies: 1
    Last Post: 01-31-2013, 03:10 PM
  4. Sign Out and Sign In Student Database
    By jamiers in forum Forms
    Replies: 6
    Last Post: 08-29-2012, 02:03 PM
  5. Replies: 35
    Last Post: 09-19-2011, 10:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums