Hi,
I have a table with fields Name, Password and then various yes/no fields which say what they are permitted to do.
I am trying to write some code which looks in that table, filters for all the records where a specific yes/no field is true (i.e. all the users that have permission to enter area A). I then put this into another table - LkUpTblNamePassStore .
This part works fine.
I then want the user to enter their password, and if that password is in the temporary table i want it to output OK (for now), if it isnt i want to output Error. I was thinking i could do it with a dcount. this is what i have so far:
strPass = Inputbox("Please Enter your Password", "PASSWORD", , 6500, 6500)
If Nz(DCount("Name", "LkUpTblNamesPassStore", "[Password] = '" & strPass & "'"), 0) = 0 Then
MsgBox "Password Error"
Else
MsgBox "OK"
End If
But it doesnt work, whatever i put in as the password it comes up with an error
Any ideas of why, or another way round it?
Thankyou!
ON FURTHER TESTING:
I have found that its because the passwords are stored in the table as a password field, i.e. they are shown as *'s. If i put in the password as the correct number of *'s it works. Obviously this isnt going to work! Is there a way round it without making the passwords visible in the table?
I have a table with fields Name, Password and then various yes/no fields which say what they are permitted to do.
I am trying to write some code which looks in that table, filters for all the records where a specific yes/no field is true (i.e. all the users that have permission to enter area A). I then put this into another table - LkUpTblNamePassStore .
This part works fine.
I then want the user to enter their password, and if that password is in the temporary table i want it to output OK (for now), if it isnt i want to output Error. I was thinking i could do it with a dcount. this is what i have so far:
strPass = Inputbox("Please Enter your Password", "PASSWORD", , 6500, 6500)
If Nz(DCount("Name", "LkUpTblNamesPassStore", "[Password] = '" & strPass & "'"), 0) = 0 Then
MsgBox "Password Error"
Else
MsgBox "OK"
End If
But it doesnt work, whatever i put in as the password it comes up with an error
Any ideas of why, or another way round it?
Thankyou!
ON FURTHER TESTING:
I have found that its because the passwords are stored in the table as a password field, i.e. they are shown as *'s. If i put in the password as the correct number of *'s it works. Obviously this isnt going to work! Is there a way round it without making the passwords visible in the table?
Last edited: