•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 392,071 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,248 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 2718 | Replies: 3 | Solved
![]() |
•
•
Join Date: Feb 2006
Posts: 30
Reputation:
Rep Power: 3
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
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:
Rep Power: 3
Solved Threads: 0
Resolved.
i just needed Or in it as shown below
i just needed Or in it as shown below
Do Until r = flxItems.Rows - 1 or flxItems.TextMatrix(r, 1) = txtProductBarcode r = r + 1 Loop
•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 107
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
adsense adult advertising biometrics blogging bomb book business coding community copyright development earth engine environment failure forum google internet legal malware marketing mcafee microsoft monetization msn news operating pagerank phishing photo privacy publishing revenue search security seo silverlight software space spyware support system technical universe video web webmaster wiki yahoo
- 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



Linear Mode