I'm trying to see if I can use DLookup instead of a Recordset to find a specific record.
To find this record I think I only need one criteria. The problem is that this record must be the record with the oldest date amongst all the records with this criteria.
The expression part of the Dlookup code "Bottom 1 EndDate" obviously needs tweaking or is that even possible?
I guess I could create a RecordSet and then loop though the RecordSet picking out records where the "[ProjectID] = " & Me.ProjectID and then storing the EndDate into an array; which I could then use to compare each array entry to each other. But this seems like the Long Way Round to me.
Is this the best way of going about this or is there a better way?
Any Ideas Welcome, Thanks.
To find this record I think I only need one criteria. The problem is that this record must be the record with the oldest date amongst all the records with this criteria.
Code:
DLookup("Bottom 1 EndDate", "TBTasks", "[ProjectID] = " & Me.ProjectID)
I guess I could create a RecordSet and then loop though the RecordSet picking out records where the "[ProjectID] = " & Me.ProjectID and then storing the EndDate into an array; which I could then use to compare each array entry to each other. But this seems like the Long Way Round to me.
Is this the best way of going about this or is there a better way?
Any Ideas Welcome, Thanks.
Comment