Microsoft KB Archive/113812

= How To Create a Menu with a Variable Pad =

Article ID: 113812

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft FoxPro 2.0
 * Microsoft FoxPro 2.5b for MS-DOS
 * Microsoft FoxPro 2.5a
 * Microsoft FoxPro 2.5b for MS-DOS
 * Microsoft FoxPro 2.6 for MS-DOS
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.5a
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.6 Standard Edition

-



This article was previously published under Q113812



SUMMARY
This article demonstrates how to make a menu choice vary with the contents of a database field by using the Menu Builder and very little code.



MORE INFORMATION
Use one of the following examples, depending on your version of FoxPro.

FoxPro 2.x Example
The following steps show how to create a menu that contains a pad whose name equals the CITY field of the current record in SALESMAN.DBF, one of the sample databases provided with FoxPro.   In the Command window, issue the following commands to set the default working directory to the TUTORIAL subdirectory and open the SALESMAN.DBF database: SET DEFAULT TO C:\\TUTORIAL USE SALESMAN   In the Command window, type the following command to display the database's structure: DISPLAY STRUCTURE Note that the database contains a character field called CITY.   In the Command window, type the following command to create a menu design called CHGPAD: CREATE MENU CHGPAD   In the Prompt box, type the following text:

\<"+alltrim(city)+"

Visual FoxPro Example
  In the Command window, issue the following commands to set the default working directory to the TUTORIAL subdirectory and open the EMPLOYEE.DBF database: SET DEFAULT TO C:\VFP\SAMPLES\DATA USE EMPLOYEE   In the Command window, type the following command to display the database's structure: DISPLAY STRUCTURE Note that the database contains a character field called CITY. </li>  In the Command window, type the following command to create a menu design called CHGPAD: CREATE MENU CHGPAD </li>  In the Prompt box, type the following text:

\<"+alltrim(city)+"