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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid.Row not counting right

Status
Not open for further replies.

vsprogrammer

Programmer
Jun 26, 2006
40
CA
Hello,

I have a grid where when you click on a name it populates all the clients information ie. their name, age, dob, address, etc. Currently it only shows the first three names and you have to scroll down to see the forth name. This works fine when you click on the first three names, however, when you scroll down to the forth name it still shows grdBeneficiaries.Row as the second row instead of the third row, which means that it is showing the info for the third person not the forth person. It seems like it is counting the rows that are showing on the screen instead of the rows that are actually in the grid. Can somebody tell me how to tell it that it is actually on grid row 4 instead of grid row 3. Hope this makes sense. Thanks in advance for the help
 
grid.Row" is counting the rows displayed in the grid and not the rows in the underlying recordsource.

A grid is a display device ... not a data repository. The real repository of the data is the recordsource (usually a recordset) to which the grid is bound. The only things that are "in" the grid are the rows being displayed and scrolling the grid just repositions rows from the data source into grid rows. Think of the grid as a window that you look through to see the records in the recordsource. You can move it up or down to see different rows. The first row that you see through the window is "Row 1" of the display even though it may be Row 5555 in the underlying recordsource.

In your case, if only three rows are being displayed then there is no grid.row 4. The grid has only 3 rows.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top