Can i use Dlookup to this

L

Lasse

Hi

I have a problem and I think someone in this forum can solve the problem.

In a form I have data from a tabel, and the user can set filter.
I want to add a textbox to show sum(Quantity) with the filter.
But I only want to sum them with the highest Rev grouped by Supplier,
Prodno.

The table have alot of fields and some of them is viewed in the form

Row :Supplier :prodno : Rev : Quantity : Price
1 :A :AA111 :R2 : 5 :56
2 :A :AA112 :R1 : 7 :28
3 :B :AA112 :R1 : 5 :14
4 :B :AA112 :R2 : 8 :14

and the sum(Quantity) should sum row 1, 2, 4 ( sum(Quantity) = 20)
Row 3 and 4 have the same Supplier and Prodno but Row 4 have a higher Rev.

I can´t use sum(Quantity) in the form because of the (group by).
I can´t use dlookup because of the (group by).

Does anyone have a solution of this problem?

//Lasse
 
Top