943,522 Members | Top Members by Rank

Ad:
Nov 24th, 2008
0

help me to fix my counter

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
denine is offline Offline
7 posts
since Nov 2008
Nov 24th, 2008
0

Re: help me to fix my counter

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.
Reputation Points: 49
Solved Threads: 44
Posting Pro in Training
hkdani is offline Offline
426 posts
since Nov 2007
Nov 24th, 2008
0

Re: help me to fix my counter

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
Reputation Points: 10
Solved Threads: 1
Newbie Poster
denine is offline Offline
7 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: the form that wont die...
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Register DLL and OCX





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC