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=<Column>

           This.RowHeight=VAL(This.Tag)*5
    
    ELSE

           This.RowHeight=VAL(This.Tag)
    
    ENDIF

NOTE: <Column> 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.

MORE INFORMATION

Steps to Reproduce Problem

  1. Create a new form and add a grid.

  2. 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.

  3. 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
    

  4. 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.
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


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 29, 1997
©1997 Microsoft Corporation. All rights reserved. Legal Notices.