| | |
MSFlexGrid Search Loop
Thread Solved |
•
•
Join Date: Feb 2006
Posts: 30
Reputation:
Solved Threads: 0
what i want it to do :
enter a barcode
search grid
if barcode exists then increase Quantity by 1, recalculate subtotal, set vIndex to last row.
if barcode does not exist then search database for data, insert data ( getProduct, currently working)
current code
the problem
1st item added correctly. subsequent data for (R+1, 1) goes in correct cell but also in the cell (0,1). and other items will not add correctly.
attached is the whole code for the form.
any help woild be great.
enter a barcode
search grid
if barcode exists then increase Quantity by 1, recalculate subtotal, set vIndex to last row.
if barcode does not exist then search database for data, insert data ( getProduct, currently working)
current code
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub searchItems() Do Until r = flxItems.Rows - 1 flxItems.TextMatrix(r, 1) = txtProductBarcode r = r + 1 Loop If txtProductBarcode = flxItems.TextMatrix(r, 1) Then currQty = flxItems.TextMatrix(r, 4) flxItems.TextMatrix(r, 4) = currQty + 1 flxItems.TextMatrix(r, 5) = Format(flxItems.TextMatrix(r, 3) * flxItems.TextMatrix(r, 4), "Currency") txtProductBarcode = "" vIndex = flxItems.Row - 1 vIndex = vIndex + 1 Else Call getProduct End If End Sub
the problem
1st item added correctly. subsequent data for (R+1, 1) goes in correct cell but also in the cell (0,1). and other items will not add correctly.
attached is the whole code for the form.
any help woild be great.
•
•
Join Date: Feb 2006
Posts: 30
Reputation:
Solved Threads: 0
Resolved.
i just needed Or in it as shown below
i just needed Or in it as shown below
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Do Until r = flxItems.Rows - 1 or flxItems.TextMatrix(r, 1) = txtProductBarcode r = r + 1 Loop
![]() |
Similar Threads
- finding max value of 10 integers (C++)
- Extracting Numbers (C)
- Allocating Memory (C++)
- Subfolder Search Loop (Visual Basic 4 / 5 / 6)
- Help with Java programming for lottery (Java)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: dll in VB
- Next Thread: hello hope you can help me, have a look and let me know
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college 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 save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






