i'm very sorry if i wans't able to mention where my error is. actually, i just find it out that im not suppose to make a counter during adding of files on the database but instead i will going to count the quantity of the product within the specified range of time during inquiry. now this my code.
Set SALE = Dbase.OpenRecordset("Select * from SalesTable")
SALE.MoveFirst
Do Until SALE.EOF
If DTPicker1.Value <= SALE!SalesDate And _
DTPicker2.Value >= SALE!SalesDate Then
If SALE!ProdCode = SALE!ProdCode Then
x = SALE!Quantity + SALE!Quantity
With grd
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = SALE!ProdCode
.TextMatrix(.Rows - 1, 1) = SALE!ProdName
.TextMatrix(.Rows - 1, 2) = SALE!Quantity
.TextMatrix(.Rows - 1, 3) = x
.TextMatrix(.Rows - 1, 4) = Format((SALE!Price * SALE!Quantity), "##.00")
End With
total = total + grd.TextMatrix(grd.Rows - 1, 4)
End If
End If
SALE.MoveNext
Loop