help me to fix my counter

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 7
Reputation: denine is an unknown quantity at this point 
Solved Threads: 1
denine denine is offline Offline
Newbie Poster

help me to fix my counter

 
0
  #1
Nov 24th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 218
Reputation: hkdani is an unknown quantity at this point 
Solved Threads: 24
hkdani's Avatar
hkdani hkdani is offline Offline
Posting Whiz in Training

Re: help me to fix my counter

 
0
  #2
Nov 24th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 7
Reputation: denine is an unknown quantity at this point 
Solved Threads: 1
denine denine is offline Offline
Newbie Poster

Re: help me to fix my counter

 
0
  #3
Nov 24th, 2008
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC