Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

syntax error in query expression in MS/ACCESS 2016 (DLOOKUP)

Posted on 2016-10-16
4
Medium Priority
?
168 Views
Last Modified: 2016-10-19
I am consistently getting this error and I can't find any reason. can anyone help?

Screen-Shot-2016-10-16-at-09.52.40.png
0
Comment
Question by:João serras-pereira
  • 2
  • 2
4 Comments
 
LVL 54

Accepted Solution

by:
Ryan Chong earned 2000 total points
ID: 41845441
try:

t = Dlookup('tempoCriticidade", "Q06_zCT_criticidadeTempo", "criticidadeTicket = '" & Me.fld_criticidadeTicket & "' " )

or

t = Dlookup('tempoCriticidade", "Q06_zCT_criticidadeTempo", "criticidadeTicket = '" & replace(Me.fld_criticidadeTicket,"'","''") & "' " )
0
 

Author Comment

by:João serras-pereira
ID: 41845448
the first one worked OK! Thanks!
0
 
LVL 54

Expert Comment

by:Ryan Chong
ID: 41845535
cool, glad that it helps cheers
0
 

Author Closing Comment

by:João serras-pereira
ID: 41850685
thought it was closed....
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
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.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

971 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