How to Create a Field List Interactively in FoxPro for Windows

ID: Q135231

The information in this article applies to:

SUMMARY

While the FoxPro interface offers a number of dialog boxes that present a list of fields from which sets can be chosen, the Browse menu options do not permit fields to be specified. However, it is possible to construct a Browse statement in the Command window containing a list of fields picked through the interface, without resorting to programming. This article shows you how.

NOTE: This method is not available from Catalog Manager.

MORE INFORMATION

The Browse option is available from the following menu locations:

Both of these actions use the BROWSE LAST command, which you can see by examining the Command window. If the resource file is enabled, the BROWSE LAST command displays the fields and layout of the browse for the currently selected table as it was last viewed.

To specify which fields are to be viewed in a browse, you must run the BROWSE command from the Command window. Unfortunately, interactively specifying more than a dozen or so fields in the Command window is a tedious and time-consuming process. Also, under the following circumstances, the entire command must re-entered to return the desired results:

The following method is less elegant than most FoxPro solutions in that it generates a harmless error, but its use during interactive sessions is adequately warranted.

Steps to Interactively Create the Browse Field List

1. Ensure that both the Command window and the database are open.

2. On the Database menu, click Append From.

3. In the From field, enter a non-existent filename such as ZZZ.

4. Click the Fields button, and select the desired fields.

5. Leave the File Type selected at the default: Table (DBF).

6. Optionally, select any desired Criteria.

7. Once all clauses have been specified, choose Append.

8. Press any key after the error "File 'zzz.dbf' does not exist."

9. In the Command window, select APPEND FROM ZZZ, and type BROWSE, and then

   Return.

Once the Browse has executed, the displayed fields can be modified by scrolling up to the command in the Command window and locating the desired fields in the Fields list.

Additional reference words: FoxWin 2.60a list box dBASE browser popup fieldlist KBCategory: kbui KBSubcategory: FxotherGeneral

Last Reviewed: August 21, 1995