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

x
?
Solved

Access DLookup

Posted on 2016-10-01
18
Medium Priority
?
64 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
  • 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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 2000 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

Independent Software Vendors: 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 month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

782 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