Microsoft KB Archive/149853

= Microsoft Knowledge Base =

FIX: Record Out of Range Error Changing Column RowHeight
Last reviewed: October 29, 1997

Article ID: Q149853

The information in this article applies to:


 * Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0

SYMPTOMS
Attempting to increase the RowHeight property from the When, Valid, GotFocus, or LostFocus events within a grid results in the following error message:

Record out of Range. This occurs only when you click one column and then another.

WORKAROUND
By placing the following code in the corresponding property or event, the error message does not occur:

 In the Tag property of the grid, place the code: =STR(This.RowHeight)  In the AfterRowColChange event of the Grid, place the code: IF nColIndex= This.RowHeight=VAL(This.Tag)*5 ELSE This.RowHeight=VAL(This.Tag) ENDIF 

NOTE:  is the number of the column that the RowHeight will increase within the grid.

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0a.

Steps to Reproduce Problem
 Create a new form and add a grid. Add the Customer table from the C:\Vfp\Samples\Data\Testdata.dbc to the DataEnvironment of the form. Set the RecordSource property of the grid to Customer and the RecordSourceType to alias.  In the GotFocus, LostFocus, When, or Valid event of the text box, increase the size by including this code: This.Parent.Parent.RowHeight=This.Parent.Parent.RowHeight*5 Or decrease the size by including this code: This.Parent.Parent.RowHeight=This.Parent.Parent.RowHeight/5  Click another column within the grid. The error message "Record out of Range" appears. This behavior happens only when you click from one column to another column in the same grid.</li></ol>

Keywords         : buglist3.00 buglist3.00b buglist5.00 FxprgGrid vfoxwin vfpfix5.0a kbprg kbbuglist kbfixlist Version          : 3.0 3.0b 5.0 Platform         : WINDOWS Issue type       : kbbug Solution Type    : kbfix