anybody can help me to fix my counter. until now i'm still stack on this error.

counter

For i = 1 To grd.Rows - 1
With INV
If grd.TextMatrix(i, 0) = INV!ProdCode Then
.Edit
!Quantity = !Quantity + Val(grd.TextMatrix(i, 3))
.Update
Else
.AddNew
!ProdCode = grd.TextMatrix(i, 0)
!ProdName = grd.TextMatrix(i, 2)
!Quantity = grd.TextMatrix(i, 3)
!Date = DTPicker1.Value
.Update
End If
End With
Next i

Recommended Answers

All 2 Replies

Ok. You need help. You're stuck on this error. Ok. But what is the error you're stuck on. You failed to mention the error.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.