Business Software Training and News

22 Responses to MS Access 2010 – How to create a login form in access

  1. KeviinAlexius says:

    hi im having an error. help!!!!

    compile error:
    Do without loop

  2. Ritxzx says:

    Hi george or anyone that can help me out
    i wonder how to create a Cancel button??
    anyone can help me out plz
    ty

  3. MultiBnar says:

    i wonder whene database opens,without entering username and password..could you open any form or any object in the object list,,i did created a LoginForm but it lets me to click on any other object without even entering username and password

  4. pcgamer546 says:

    Hi george, i got problem that i do what u told me… but

    then when i close the access and open agai it opens the login open that i created. it doesnt open the login text box so what did i do wrong …

  5. TrueNorthOutdoors says:

    This was great. I really appreciate. For anyone else worried about security, do as George suggests and in the properties of form frmLogin, set Close Button to ‘No’, this will not allow any user to simply close the form and have access to your db. Also, set the Shortcut Menu to ‘No’, this will disable the ability to right click on the form and open it in design view. Again, thanks George, this is exactly what I needed.

  6. sanro says:

    Hello, Great Video! After I try logging in, it tells me incorrect name and pw, but I have entered all the correct info, any ideas?

  7. GeorgeLoseby says:

    Hi ben – make sure there is not a space between rstUserPwd! and [Password] also this must all be on one line if you want to break the line use a underscore _ after the And.
    Regards,
    George

  8. benm09 says:

    Hi I am having trouble with this line of code:
    If rstUserPwd![UserName] = Form_frmLogin.TxtUsername.Value And rstUserPwd! [Password] = Form_frmLogin.TxtPassword.Value Then

    I have checked the names against my query and textbox names etc and they all match.

    the error says:
    ” compile error:
    Expected: then or go to”

    Can you help me please ?

  9. amithpatel says:

    hello I am getting this error “type-declaration character does not match declared data type” for rstUserPwd any idea?

  10. amithpatel says:

    Hello, we you able to resolve this error? I am getting it too.. If yes, what was the fix…

  11. LordJimboeFarquard says:

    Where do I get access to the login script?
    Forgive me, I’m a newbe

  12. blakelcy says:

    I got that error too. Mine was from this line: If rstUserPwd![UserName] = LoginFrm.txtUsername.Value
    In my case I just needed to replace LoginFrm.txUserName.Value with me.txtUserName.Value

  13. Xplojon says:

    How do you get the command to run once access if opened???

  14. PHStudiosNL says:

    Private Sub cmdLogin_Click()

    Dim dbs As Database
    Dim rstUserPwd As Recordset
    Dim bFoundMatch As Boolean

    Set dbs = CurrentDb

    Set rstUserPwd = dbs.OpenRecordset(“qryUserPwd”)

    bFoundMatch = False

    If rstUserPwd.RecordCount > 0 Then
    rstUserPwd.MoveFirst

    Do While rstUserPwd.EOF = False
    If rstUserPwd![Username] = Form_frmLogin.txtUsername.Value And rstUserPwd![Password] = Form_frmLogin.txtPassword.Value Then
    bFoundMatch = True
    Exit Do

  15. PHStudiosNL says:

    End If
    rstUserPwd.MoveNext
    Loop

    End If

    If bFoundMatch = True Then
    DoCmd.Close acForm, Me.Name
    DoCmd.OpenForm “Tekoop”

    Else
    MsgBox “Incorrect Username or password”

    End If

    rstUserPwd.Close

    End Sub

  16. danreyes21 says:

    Can u do a video on the query u ran? I have everything in the code exactly like yours and I’ve named everything the same… I don’t think I ran the query correctly… Fast response would be greatly appreciated. Thanks.

  17. AKAR988 says:

    Hi, I have an error says: “error 424 object required”, I tried to fix it but i could’nt, plz help me

  18. skalim27 says:

    Can we get this code somehw
    

  19. jbranget says:

    George… Would you be able to paste your entire procedure code here. It will make it much easier to have something to start with.

    Thanks.

  20. GeorgeLoseby says:

    Hi all, unfortunately I haven’t been able to get all of your questions I have just too busy to be able to respond to each one. I am hoping to put up another tutorial in the next few weeks (with better sound) in which we can tackle a few of these questions. Regards, George

  21. emheeb says:

    Can you tell me what it was?
    

  22. emheeb says:

    Hi George, I dont really get what this means. Can you show a picture (or explain more vividly)? This is my first time using VB and I’m happy to say I think I have it all figured out excpet the format of this query.

© 2013 BooksTraining.com
  Click here to see Microsoft Access training discounts.
No thank you. Continue to Microsoft Access training discounts .