shieldsco
asked on
Access DLookup
I using the dlookup below however I get an error. Any thoughts.
=
=
DLookUp("Time Start","qryLastAuditLogDate","Time Start = " & [Time Start])
ASKER
still get an error#
What is the error number ?
ASKER
It's a lookup on a form... #error
Do you have
=DLookkup()
(equal sign in front of DLookup) ?
And where does [Time Start] exist ?
=DLookkup()
(equal sign in front of DLookup) ?
And where does [Time Start] exist ?
ASKER
Here's the sql
SELECT Max(tbl_Inactivity.[Time Start]) AS [MaxOfTime Start] FROM tbl_Inactivity;
(note the brackets around Time Start
=DLookUp("Time Start","qryLastAuditLogDat e","[Time Start] = " & "#" & [MaxOfTime Start] & "#")
or
=DLookUp("Time Start","qryLastAuditLogDat e","[Time Start] = " & [MaxOfTime Start])
=DLookUp("Time Start","qryLastAuditLogDat
or
=DLookUp("Time Start","qryLastAuditLogDat
ASKER
I get an error : #Name? on both
"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])
Not sure what you mean ?
You are using DLookup to grab a value from a query, right ?
Theses ... more brackets
=DLookUp("[Time Start]","qryLastAuditLogDate","[
or
=DLookUp("[Time Start]","qryLastAuditLogDate","[
ASKER
Yes using Dlookup to grab a value from a query. Tried both and get #Name?
If you run that SQL by itself, what does it return ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why not use DMAX, and do away with the query as the control's record source:
=DMAX("[Time Start]","tbl_Inactivity")
=DMAX("[Time Start]","tbl_Inactivity")
ASKER
Thanks
Sorry for the confusion. It was late :-)
ASKER
No problem Joe
DLookUp("Time Start","qryLastAuditLogDat