Microsoft KB Archive/177145

= PRB: Error Changing DynamicCurrentControl of Grid Column at Run Time =

Article ID: 177145

Article Last Modified on 12/11/1999

-

APPLIES TO


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

-



This article was previously published under Q177145



SYMPTOMS
When you switch between controls in a grid's column at run-time the following error message appears:

Expression is invalid, use a valid expression for

DynamicCurrentControl.



RESOLUTION
When you set or change the DynamicCurrentControl property of a grid's Column, use '"combo1"' (an additional pair of quotes around the control string) instead of "combo1." Here's an example: ThisForm.Grid1.Column1.DynamicCurrentControl = '"combo1"'



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Create a database, named Data1, and add a new table, Table1, with two fields. The first field will be ID(C10) and the second field will be Name(C20). Next, insert some records into the table. Create a new form and include Table1 in its DataEnvironment. Drag the table onto the form to create a grid control based on the table. Add a combo box control in Grid.Column1.  Add a command button to the form, and type the following code in the Click event: ThisForm.Grid1.Column1.DynamicCurrentControl = "combo1" ThisForm.Refresh   Run the form and click the command button to produce the error: Expression is invalid, use a valid expression for DynamicCurrentControl. NOTE: Using views causes the same error. </ol>

Additional query words: DynamicCurrentControl grid combobox views

Keywords: kbprb KB177145

-

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

© Microsoft Corporation. All rights reserved.