IF TYPE('ofrmProfile.pgfProfile.pagPolicy.accountgrid')="O" .and. !ISNULL(ofrmProfile.pgfProfile.pagPolicy.accountgrid) WITH ofrmProfile.pgfProfile.pagPolicy.accountgrid SELECT TACCOUNT .SetFocus() FOR i= 1 TO .ActiveRow-1 .DoScroll(0) ENDFOR ENDWITH ENDIF IF TYPE('ofrmProfile.pgfProfile.pagPolicy.policygrid')="O" .and. !ISNULL(ofrmProfile.pgfProfile.pagPolicy.policygrid) WITH ofrmProfile.pgfProfile.pagPolicy.policygrid SELECT TPOLICY .SetFocus() FOR i= 1 TO .ActiveRow-1 .DoScroll(0) ENDFOR ENDWITH ENDIFI have two grids on a form. Each resides on its own pageframe. I want each grid to be sitting at the last record in the table when it first has focus. This has been done easily. However, what happens is that the grid is automatically scrolled to the bottom of the grid and the only line visible in the grid is that last row. I need to determine how many scrolls I need to perform to make as many rows visible as can be done based on the height of the grid without losing the visibility of the last row in the grid. I know, in one example, the .activerow property = 4 and the .relativerow property = 1. The grid height is 134 and the row height is 18.
WITH ofrmProfile.pgfProfile.pagPolicy.accountgrid .SetFocus() FOR i= 1 TO .ActiveRow-1 .DoScroll(0) ENDFOR ENDWITH WITH ofrmProfile.pgfProfile.pagPolicy.policygrid .SetFocus() FOR i= 1 TO .ActiveRow-1 .DoScroll(0) ENDFOR ENDWITHTIA,