Solved

Access DLookup

Posted on 2016-10-01
18
50 Views
Last Modified: 2016-10-02
I using the dlookup below however I get an error. Any thoughts.


=
DLookUp("Time Start","qryLastAuditLogDate","Time Start = " & [Time Start])

Open in new window

0
Comment
Question by:shieldsco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
18 Comments
 
LVL 75
ID: 41825123
Try this.  And what is the error you are getting ?

DLookUp("Time Start","qryLastAuditLogDate","Time Start = " & "#" & [Time Start] & "#")
0
 

Author Comment

by:shieldsco
ID: 41825130
still get an error#
0
 
LVL 75
ID: 41825134
What is the error number ?
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 

Author Comment

by:shieldsco
ID: 41825137
It's a lookup on a form... #error
0
 
LVL 75
ID: 41825140
Do you have
=DLookkup()

(equal sign in front of DLookup) ?

And where does [Time Start]  exist ?
0
 

Author Comment

by:shieldsco
ID: 41825149
Here's the sql
SELECT Max(tbl_Inactivity.[Time Start]) AS [MaxOfTime Start] FROM tbl_Inactivity;

Open in new window

0
 
LVL 75
ID: 41825152
(note the brackets around Time Start

=DLookUp("Time Start","qryLastAuditLogDate","[Time Start] = " & "#" & [MaxOfTime Start] & "#")

or

=DLookUp("Time Start","qryLastAuditLogDate","[Time Start] = " & [MaxOfTime Start])
0
 

Author Comment

by:shieldsco
ID: 41825153
Last Audit Log Date is lookup

Last Audit Log Date:
0
 

Author Comment

by:shieldsco
ID: 41825155
I get an error : #Name? on both
0
 
LVL 75
ID: 41825160
"Last Audit Log Date is lookup"
Not sure what you mean ?

You are using DLookup to grab a value from a query, right ?

Theses ... more brackets

=DLookUp("[Time Start]","qryLastAuditLogDate","[Time Start] = " & "#" & [MaxOfTime Start] & "#")

or

=DLookUp("[Time Start]","qryLastAuditLogDate","[Time Start] = " & [MaxOfTime Start])
0
 

Author Comment

by:shieldsco
ID: 41825161
View
0
 

Author Comment

by:shieldsco
ID: 41825162
Yes using Dlookup to grab a value from a query. Tried both and get #Name?
0
 
LVL 75
ID: 41825164
If you run that SQL by itself, what does it return ?
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 41825165
Wait ... that SQL is only returning one value ... so this is all you should need

=DLookUp("[MaxOfTime Start]","qryLastAuditLogDate")
0
 
LVL 1

Expert Comment

by:ms3930
ID: 41825382
Why not use DMAX, and do away with the query as the control's record source:

=DMAX("[Time Start]","tbl_Inactivity")
0
 

Author Closing Comment

by:shieldsco
ID: 41825387
Thanks
0
 
LVL 75
ID: 41825515
Sorry for the confusion. It was late :-)
0
 

Author Comment

by:shieldsco
ID: 41825532
No problem Joe
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

734 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