Solved

Access DLookup

Posted on 2016-10-01
18
54 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
Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

 

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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

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