I am building a password module.
I have a table called pass and on a form I have 2 text boxes. nameenter and passenter.
The form is generic and will open another generic form.
My problem is the code is not looking at the entire pass table for the user name and password. My logic may be off but here is what I have.
Dim pwd As String
Dim nam As String
pwd = DLookup("password", "Pass"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
nam = DLookup("username", "Pass"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
If nam <> Me.nameenter Or IsNull(Me.nameenter) = True Then
MsgBox "You have entered an invalid User ID"
Else
If pwd <> Me.passenter Or IsNull(Me.passenter) = True Then
MsgBox "You have entered an invalid password."
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Data"
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End If
Thanks in advance
Kenny
I have a table called pass and on a form I have 2 text boxes. nameenter and passenter.
The form is generic and will open another generic form.
My problem is the code is not looking at the entire pass table for the user name and password. My logic may be off but here is what I have.
Dim pwd As String
Dim nam As String
pwd = DLookup("password", "Pass"
nam = DLookup("username", "Pass"
If nam <> Me.nameenter Or IsNull(Me.nameenter) = True Then
MsgBox "You have entered an invalid User ID"
Else
If pwd <> Me.passenter Or IsNull(Me.passenter) = True Then
MsgBox "You have entered an invalid password."
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Data"
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End If
Thanks in advance
Kenny