Hii,
I am currently trying to produce some code that can be used on a login form within my database. How do I make it so that the login will accept multiple usernames and passwords? There are a couple of member login details stored in the tblLogin, however I don't know how to code it for this. It works when I hardcode a username and password into the code, but how do I make it so that it accepts more than one username and password?
Here is the code I have
Could do with some guidance and help urgently!
Many thanks.
I am currently trying to produce some code that can be used on a login form within my database. How do I make it so that the login will accept multiple usernames and passwords? There are a couple of member login details stored in the tblLogin, however I don't know how to code it for this. It works when I hardcode a username and password into the code, but how do I make it so that it accepts more than one username and password?
Here is the code I have
Code:
Private Sub cmdSubmit_Click()
If txtUsername = "Jon.Hughes" Then
If txtPassword = "Password" Then
DoCmd.Close
DoCmd.OpenForm ("frmHomepage")
MsgBox ("You Have Successfully Logged In.")
Else
txtUsername = ""
txtPassword = ""
MsgBox ("Incorrect. Please Try Again.")
End If
Else
txtUsername = ""
txtPassword = ""
MsgBox ("Incorrect. Please Try Again.")
End If
End Sub
Could do with some guidance and help urgently!
Many thanks.