I pose a question as a newbie here -
I have been trying to do the following : I created a form that is set to start-up first. I know that microsoft security is better for security and I won't be using it anyway. I have the person type into 2 list boxes their username and password, and then want it to compare to a table named UserList. I have tried a couple different ways to compare the data, but the way I think I should do it is as such.
I know there are many errors in that code and some of it I just type in right now to get the idea of what I am trying to do. Any help would be appreciated!
I have been trying to do the following : I created a form that is set to start-up first. I know that microsoft security is better for security and I won't be using it anyway. I have the person type into 2 list boxes their username and password, and then want it to compare to a table named UserList. I have tried a couple different ways to compare the data, but the way I think I should do it is as such.
Code:
Private Sub cmdLogin2_Click()
On Error GoTo Err_cmdLogin2_Click
Dim stUserName1, stusername2, stpassword1, stPassword2, As String
Set stUserName1 = me.lstUserID
Set stusername2 = me.lstPassword
Set stpassword1 = tables.userlist("Password")
Set stPassword2 = tables.userenter("Password")
IIf ((stUserName1 = stusername2) = True), (Open Form "Sample"), (MsgBox("Incorrect UserName or Password!", Open Form "Login")
Exit_cmdLogin2_Click:
Exit Sub
Err_cmdLogin2_Click:
MsgBox Err.Description
Resume Exit_cmdLogin2_Click
End Sub
Comment