Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21982

VB6 Moving Array Elements into Textbox

$
0
0
Hi all,

I have an array, and I want to copy certain fields of a row and column to a textbox.

The program is to evaluate the 5th column of every row. If the 5th column has a '1', it copies the 1st column of that row to the text box. In other words, if a given row has the elements 7 2 3 4 1 5, since the 5th element is equal to one, copy the first element of that row to the text box which is 7.

My problem is, it only copies the last instance of column 5 having a 1, and leaves the other rows out. How can I copy all of the instances of this to the text box instead of just the last?

What I have is below.

Code:

For R = 0 To endrows                  ' Cycle through all rows
    If (B(R, C) = "1") Then              ' If the 5th column of a row has a 1
        Text1.Text = B(R, C)            ' then copy the 1 value in that row to the textbox
    End If
Next R


Viewing all articles
Browse latest Browse all 21982

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>