How to Change Object Properties Based on a Logical Field

Last reviewed: August 4, 1995
Article ID: Q134313
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SUMMARY

Visual FoxPro has the ability to refresh an object on a form based on a logical field in a table.

MORE INFORMATION

Step-by-Step Procedure

  1. Create a new .dbf file called Junk with a logical field named Logic.

  2. Enter two or three records with True (.T.) valuses in the Logic field and two or three records with False (.F.) values in the Logic field.

  3. Issue the following command in the Command window:

    CREATE FORM Test

  4. Select the command button object from the Form Controls toolbar, and place it on the form.

  5. In the Refresh property for th command button, type:

    THIS.VISIBLE=Junk.Logic

    This will cause the object to be visible or not visible based upon the value in the Junk.dbf table.

  6. Create another command button on the form.

  7. Double-click the button and in the click event for this button, type the following two commands:

       SKIP              && move the record pointer
       THISFORM.REFRESH  && refresh the screen
    
    

  8. Click the exclamation mark on the toolbar to save and run the form.

  9. Click the second command button and note how the first command button appears and disappears based on the value of the logical field in the table.


Additional reference words: 3.00 VFoxWin
KBCategory: kbtool
KBSubcategory: FxtoolFormdes


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: August 4, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.