Ok so I built the table, etc...then I created a login form...behind the form I have this code:
Private Sub cmd_OK_Click()
Dim tmpID As String
' Check to see if Login box is empty
If IsNull(Me.cmb_Login) Or Me.cmb_Login = "" Then
MsgBox "You must choose a User Name.", vbOKOnly, "Required Data"
Me.cmb_Login.SetFocus
Exit Sub
End If
' Check to see if Password box is empty
If IsNull(Me.txt_Pass) Or Me.txt_Pass = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txt_Pass.SetFocus
Exit Sub
End If
' Check to see if Password entered matches password in Logon table
If Me.txt_Pass.Value = DLookup("UPassword", "Logon", "[UName]= " & Me.cmb_Login.Value) Then
tmpID = Me.cmb_Login.Value
MyID = tmpID
' Close logon form and open main form
DoCmd.Close acForm, "Logon", acSaveNo
DoCmd.OpenForm "Account"
End If
End Sub
HOWEVER it keeps errroring out at: If Me.txt_Pass.Value = DLookup("UPassword", "Logon", "[UName]= " & Me.cmb_Login.Value) Then...saying 'The object doesn't contain the Automation object 'admin''.
I don't understand where I am wrong...HELP!