The user enters their password on a form frmCriteria, in an unbound field txtCriteria, on click:
Everything works fine, exept now I want to add a textbox, with strUsrLogin, how would I do this? I played around with the Dlookup, with no success. I tried copying Like setcriteria(), in the query, as a criteria for the strUsrLogin, no luck either.
Private Sub cmdOK_Click()
On Error GoTo Err_cmdOK_Click
gCriteria = Me!txtCriteria
' hide criteria form
DoCmd.RunMacro "mcrHideCriteria"
' close criteria form
DoCmd.close A_FORM, "frmCriteria"
' check to see if there are any records for this query
If DCount("[strUsrPsswd]", "qselDemo") < 1 Then
MsgBox "Sorry that password doesn't match.", 64, "Error"
Exit Sub
Else
DoCmd.OpenForm "frmDataEntry"
End If
Exit_cmdOK_Click:
Exit Sub
Err_cmdOK_Click:
MsgBox Error$
Resume Exit_cmdOK_Click
End Sub
The query is: qSelDemo,
One of the fields strUsrPsswd uses Like setcriteria() as criteria.
Any idea's for checking BOTH?
Everything works fine, exept now I want to add a textbox, with strUsrLogin, how would I do this? I played around with the Dlookup, with no success. I tried copying Like setcriteria(), in the query, as a criteria for the strUsrLogin, no luck either.
Private Sub cmdOK_Click()
On Error GoTo Err_cmdOK_Click
gCriteria = Me!txtCriteria
' hide criteria form
DoCmd.RunMacro "mcrHideCriteria"
' close criteria form
DoCmd.close A_FORM, "frmCriteria"
' check to see if there are any records for this query
If DCount("[strUsrPsswd]", "qselDemo") < 1 Then
MsgBox "Sorry that password doesn't match.", 64, "Error"
Exit Sub
Else
DoCmd.OpenForm "frmDataEntry"
End If
Exit_cmdOK_Click:
Exit Sub
Err_cmdOK_Click:
MsgBox Error$
Resume Exit_cmdOK_Click
End Sub
The query is: qSelDemo,
One of the fields strUsrPsswd uses Like setcriteria() as criteria.
Any idea's for checking BOTH?