The third DLookup argument, criteria, is an optional string expression that is similar to the WHERE clause in an SQL statement, without the word WHERE ".
In yours, you seem to be trying to assign the value of a control named inuser . However, you are actually passing a string containing the text "inuser.Value".
DLookup("cusername", "tbl_users", "inuser.Value")
But that will not give you what you want, even if you remove the quotation marks.
If you want to find the cusername from tbl_users where some kind of field (maybe user_id ) matches inuser.Value ...
DLookup("cusername", "tbl_users", "user_id = " & inuser.Value)
If this field, user_id , is a textual rather than a numeric data type, quotes the criteria string ...
DLookup("cusername", "tbl_users", "user_id = '" & inuser.Value & "'")
It seems to me that you have a problem with the same type with DLookup("cpassword", ...) , so if I got the first one on the right, make a similar change there.
For more information on DLookup , see DLookup () Usage Description, Access 2000 Examples, and Troubleshooting . Although this old article still applies to the latest AFAICT access versions.