[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Syntax help needed for DLookup

Posted on 2011-10-26
2
Medium Priority
?
346 Views
Last Modified: 2012-05-12
This is so frustrating. I have asked a similar question over the years no less than 10 times. All of the answers are in my knowledge base and I still can't figure it out.

I am getting a #NAME? error for this:

DLookup("UserType", "tblUsers", "Password = " & Chr(34) & Me.Password & Chr(34) & " ")

Me.Password is text.
0
Comment
Question by:Dale Logan
  • 2
2 Comments
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 37036035
Try this:

DLookup("UserType", "tblUsers", "Password = '" & Me.Password & "'")

Ed
0
 
LVL 19

Accepted Solution

by:
MINDSUPERB earned 2000 total points
ID: 37036046
If the above is not working:

Try this one:

DLookup("UserType", "tblUsers", "[Password] = '" & [Password] & "'")

Ed
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question