Microsoft KB Archive/168043

= FIX: Grid is Empty with Incorrect Column ControlSource =

Article ID: 168043

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a

-



This article was previously published under Q168043



SYMPTOMS
Specifying an invalid column ControlSource name in a Grid results in an empty grid in Visual FoxPro 5.x. However, in Visual FoxPro 3.x, this results in the following error, which is expected:

"Error loading File - ControlSource..., Variable "column name" is not found"



RESOLUTION
Check the ControlSource names in each column and make sure they are valid names.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This has been corrected in Visual FoxPro 6.0.



Steps to Reproduce Behavior
  Run the following code from a program (.PRG) file: SET SAFETY ON     USE HOME+'samples\data\customer' LOCAL aobj[1], ox     CREATE FORM TEMP NOWAIT =ASELOBJ(aobj,1) ox = aobj[1] ox.AddObject('grid1','Grid') WITH ox.grid1 .Recordsource = 'customer' .Visible = .T.        .ColumnCount = 2 .Column1.ControlSource = 'customer.cust_id'

* Purposely put an invalid column controlsource name .Column2.ControlSource = 'customer.Xcontact'

* To display the Grid correctly set: *  .Column2.ControlSource = 'customer.contact'

ENDWITH KEYBOARD 'Y' CLEAR RELEASE WINDOW 'Form Designer' DO FORM temp  Form shows up with an empty grid.

Additional query words: kbvfp600fix

Keywords: kbbug kbfix KB168043

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.