Using that sample that you gave me I tried to snip off some bits and eventually ended up with this. Note: My username in the table is CustomerID. Password is LastName. My username input on the form is CustomerID as well and the Password input is also LastName.
Private Sub Command5_Click()
Dim strUser As String
Dim strPWD As String
Dim intUSL As Integer
strUser = Me.CustomerID
If DCount("[LastName]", "[Customer Details Table]", "[CustomerID]='" & Me.CustomerID & "'") > 0 Then
strPWD = DLookup("[LastName]", "[Customer Details Table]", "[CustomerID]='" & Me.CustomerID & "'")
If strPWD = Me.LastName Then
DoCmd.OpenForm "[Browse Menu], acNormal"
End If
End If
End Sub
For some reason though I am getting a data type mismatch on this line.
If DCount("[LastName]", "[Customer Details Table]", "[CustomerID]='" & Me.CustomerID & "'") > 0 Then