We help IT Professionals succeed at work.

Dlookup Last Record

repco
repco asked
on
Hi,

I have a table "Split" where i want to look up a record.

Record ID |   ExistingWorkOrders |   ToProduce
1                        AB                             12
2                        AB                              4
3                        AB                               2

i'm using dlookup as
=DLookUp("ToProduce","Split","Existingworkorder= '" & [rpworkorder] & "'")

I want to be able to show the last record, or the record with the Min of Qty Produced.

how can i accomplish that?
Comment
Watch Question

Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009
Commented:
last record == highest recordid?


=DLookUp("ToProduce","Split","Existingworkorder= '" & [rpworkorder] & "' and RecordID = " & DMax("record id", "Split", "Existingworkorder= '" & [rpworkorder] & "' ")  )

Open in new window

You can use DMax("ToProduce","Split","Existingworkorder= '" & [rpworkorder] & "'")
Cheers, Andrew

Author

Commented:
You guys a great!!!