Try building a query object that has the sort order defined. Then do DLookup on that query.
Try building a query object that has the sort order defined. Then do DLookup on that query.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Code:=ELookUp("CountOfActivityID","[3Wks0AttendanceMainQ ]","ActivityID = " & [Forms]![Form21]![form3new].[Form]![ActivityTableID])
See square brackets around second parameter. (As Allen Browne says at http://allenbrowne.com/ser-42.html, any names with odd characters or starting with numbers need to have square brackets round them for his ELookup function to work.)
Do you really meant to have a space at the end of your query name?