Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

looping through a grid for column 0 value 1

Status
Not open for further replies.

samantha72

Programmer
Jul 31, 2001
14
0
0
CA
Hi I am trying to loop through a grid to get column 0 value and somehow i am
getting only the first column value

grid.movefirst
for i = 0 to grid.rows - 1
inumber = grid.columns(0).text
next i
grid.movenext

Thanks
 
When you read the value, you are not specifying what row you want to read, you are only naming the column:
inumber = grid.columns(0).text
What kind of grid are you using?
 
Try this

x = grid.Rows
For i = x -1
inumber = grid.col(0).Text
Next

Of course, inumber's value will be the last value received from your grid.
Depending on what you need to do with it, you'll have to add a bit more code in your For Next...

Hope it helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top