I have a form which when opened applies the following filter.
DoCmd.ApplyFilter , "USER_ID =" & "'" & Me![UserName] & "'" & " AND " & "USER_PASSWORD = [Enter Current Password]"
Me![UserName] is supplied by a module and [Enter Current Password] is a user prompt opened when opening the form.
The goal of this filter is to return on the record for the Me![UserName] when the proper password is entered in the prompt.
This works as desired when the proper password is entered but It not doing what I want when the wrong password is entered. I hope that if I can "grab" the number of records that the filter yields I can then evaluate that number for further processing.
For example:
if NumberOfRows < 1
MsgBox "Incorrect password, please try again"
DoCmd.Close acForm, "Frm_Main"
endif
So can anyone tell me how to get this value into something I can evaluate against?
thanks you
DoCmd.ApplyFilter , "USER_ID =" & "'" & Me![UserName] & "'" & " AND " & "USER_PASSWORD = [Enter Current Password]"
Me![UserName] is supplied by a module and [Enter Current Password] is a user prompt opened when opening the form.
The goal of this filter is to return on the record for the Me![UserName] when the proper password is entered in the prompt.
This works as desired when the proper password is entered but It not doing what I want when the wrong password is entered. I hope that if I can "grab" the number of records that the filter yields I can then evaluate that number for further processing.
For example:
if NumberOfRows < 1
MsgBox "Incorrect password, please try again"
DoCmd.Close acForm, "Frm_Main"
endif
So can anyone tell me how to get this value into something I can evaluate against?
thanks you