How to Refresh a Formset by Using Commands Outside of the FormID: Q136978 The information in this article applies to:
SUMMARYWhen moving the record pointer in a table whose fields belong to an active form, the form will not refresh if the command that moved the record pointer was issued from a menu or the Command window. For example, if there is a menu item issues a SKIP command, the record pointer will move but the form will not refresh. To have your application menu item move the record pointer and refresh the form, use the SKIP command to move the record pointer. and then use the _SCREEN.FORMCOUNT and _SCREEN.FORMS().REFRESH commands to refresh a form or formset correctly.
MORE INFORMATIONIf the active form on the screen is a form and not a formset, you can use the _SCREEN.ACTIVEFORM.REFRESH command alone from the menu or Command window to refresh the form. However, if the form could be a form or a formset, it is best to make your refresh code generic, so it fits both cases. The _SCREEN.FORMCOUNT command returns the number of forms on the screen, so it allows you to refresh each form whether a single form or a formset. Then you can use the FORMS() array to refresh each form if a formset is active. The FORMS() array is created when the forms start up. It is internal to Visual FoxPro. By putting these commands in a FOR loop, you can refresh a form or formset from a menu action. For additional information about a form that uses toolbars, please see the following article in the Microsoft Knowledge Base:
Step-by-Step Example1. Create a formset with two pages, and place a field from a table on each 2. Run the form, and place the two forms side by side.
3. Type the SKIP command in the Command window and press ENTER. Note that 4. Type the _SCREEN.FORMS(1).REFRESH command in the Command window and
5. If the SKIP command is used in a menu, place the following code in the
Additional reference words: 3.00 VFoxWin
KBCategory: kbtool kbcode
KBSubcategory: FxtoolFormdes
|
Last Reviewed: September 21, 1995 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |