How to Prevent Screen Dropping Out with Disabled ButtonLast reviewed: June 27, 1995Article ID: Q125748 |
The information in this article applies to:
SUMMARYIf the screen you are running suddenly stops running after you click an object like a button, you may have code running that is disabling the object you have just clicked. For example, when you leave a GET field either by pressing the TAB or ENTER key or by clicking with the mouse, the VALID clause of that object is evaluated. If the VALID code snippit disables the next object that gets the focus, the screen will stop running. The reason you are dropping out of your screen is because the object that receives the focus has been disabled, and then receives the focus anyway. A common situation for this dilemma is where you want to allow your users to click a "Next" button to move to the next record in the table, however, if the information has been modified in one of the input objects on the screen, you want to force the user to choose to save or cancel those changes by clicking different buttons. The solution is to move the focus to an object that has not been disabled. In this case, move the focus to the Save button, diverting the focus from the Next button, even after clicking the Next button.
MORE INFORMATIONThe example steps below demonstrate a simple solution. This example uses the names "m.fieldname" for an input object, "next" and "save" for push buttons and a variable called "old_fieldname" to store the previous value of the input object. It also loads the library Foxtools, for use of the MSGBOX() function.
|
Additional reference words: FoxWin 2.50 2.50a 2.50b 2.60 2.60a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |