| | |
help me to fix my counter
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2008
Posts: 7
Reputation:
Solved Threads: 1
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
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
•
•
Join Date: Nov 2008
Posts: 7
Reputation:
Solved Threads: 1
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
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
![]() |
Similar Threads
- Creating a time counter (Visual Basic 4 / 5 / 6)
- Word Frequency Counter Help (Java)
- Help with Java letter counter (Java)
- c:\counter.cab:\counter.exe (Viruses, Spyware and other Nasties)
- c:\counter.cab:\counter.exe (Viruses, Spyware and other Nasties)
- need help on word counter (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: the form that wont die...
- Next Thread: Register DLL and OCX
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





