Search results

  1. G

    Do while loop in VBA for a login screen - Access

    The exclamation marks did not appear to do anything, the code did not work and the same message came up.
  2. G

    Do while loop in VBA for a login screen - Access

    Basically, I want the username to match the surname in a table, the password should match the user name in this table. If the user enter the password wrong 3 times the database will close. That is all I wish to do.
  3. G

    Do while loop in VBA for a login screen - Access

    The code still appears in red and says there is "Compile error. Expected: go to or then". The error appears in the "If Nz(DLookup("Surname", "tblUsers", "Password ='" & Me.txtPassword) & "'")) <> Me.txtLoginID Then Code: intLogonAttempts = 0 If IsNull(Me.txtLoginID) Then MsgBox "Please...
  4. G

    Do while loop in VBA for a login screen - Access

    I have edited the code to try and match the first code as best as I can, however it doesn't seem to work again. Dim intLogonAttempts As Long 'Check value of password in tblAssociateProfile to see if this matches value chosen in combo box If Me.txtPassword = DLookup("Password"...
  5. G

    Do while loop in VBA for a login screen - Access

    Yes I do understand the logic of what I am doing, I could easily do this in Java (what I know to code in) but every time I seem to do something it doesn't seem to want to work. Would you suggest restarting?
  6. G

    Do while loop in VBA for a login screen - Access

    I am so confused! the end sub belonged to the sub Click_command1 that someone told me to remove. The code tags are pound signs no? Code: intLogonAttempts = 0 If IsNull(Me.txtLoginID) Then MsgBox "Please enter LoginID", vbInformation, "LoginID required" Me.txtLoginID.SetFocus ElseIf...
  7. G

    Do while loop in VBA for a login screen - Access

    I have altered my code to your guys advice, the part surrounded by code tages still does not work correctly. I have deleted the Command_Click1 to ensure the intLogonAttempts is not equal to 0 every run. Code: intLogonAttempts = 0 If IsNull(Me.txtLoginID) Then MsgBox "Please enter LoginID"...
  8. G

    Do while loop in VBA for a login screen - Access

    I have altered my code to your guys advice, the part in red still does not work correctly. I have deleted the Command_Click1 to ensure the intLogonAttempts is not equal to 0 every run. Code: intLogonAttempts = 0 If IsNull(Me.txtLoginID) Then MsgBox "Please enter LoginID"...
  9. G

    Do while loop in VBA for a login screen - Access

    Code: Private Sub Command1_Click() intLogonAttempts = 0 If IsNull(Me.txtLoginID) Then MsgBox "Please enter LoginID", vbInformation, "LoginID required" Me.txtLoginID.SetFocus ElseIf IsNull(Me.txtPassword) Then MsgBox "Please enter password", vbInformation, "Password required"...
  10. G

    Do while loop in VBA for a login screen - Access

    I am very confused. I need to program the check whether the username and password combination entered is correct: IF not add 1 onto intLogonAttempts Loop until count = 3, closing the database OR the user has entered the username and password correctly, opening the database The...
  11. G

    Do while loop in VBA for a login screen - Access

    This is what I've got it says the passwords value is 1? any help. Thank you for the welcome! Code: Private Sub Command1_Click() intLogonAttempts = 0 If IsNull(Me.txtLoginID) Then MsgBox "Please enter LoginID", vbInformation, "LoginID required"...
  12. G

    Do while loop in VBA for a login screen - Access

    I have been trying to create a login screen that allows the user 3 password attempts, then it will close the database. However my loop does not work correctly and the value for the users attempts does not seem to change. Please Could someone help. Code: Option Compare Database Public...
Back
Top Bottom