PRB: "Variable <Index Key> Not Found" with SET FIELDS GLOBAL

ID: Q112319

The information in this article applies to:

SYMPTOMS

When you issue a SET FIELDS TO <field list> command and a SET FIELDS GLOBAL command, the following error message occurs:

     Variable <index key> not found

CAUSE

The field list does not contain the index KEY field.

RESOLUTION

Add the KEY field to the SET FIELDS TO <field list> command.

MORE INFORMATION

Steps to Reproduce Behavior

NOTE: We recommend that you use the CUSTOMER.DBF and INVOICES.DBF files in the TUTORIAL subdirectory for this example.

1. In the Command window, issue the following command, where <table1> is

   the name of a .DBF file:

      USE <table1>

2. In the Command window, issue the following command:

      SELECT 0

3. In the Command window, issue the following command, where <table2> is
   the name of a .DBF file:

      USE <table2>

4. In the Command window, issue the following commands:

      INDEX ON <key field> TAG key
      SET ORDER TO key
      SELECT <table1>
      SET FIELDS GLOBAL
      SET FIELDS TO <field list> && Do not include the KEY field
      SET RELATION TO <key field> INTO <table2>

Additional reference words: FoxDos FoxWin 2.60 errmsg KBCategory: kbprg kberrmsg kbprb KBSubcategory: FxprgGeneral

Last Reviewed: June 27, 1995