Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/105587

From BetaArchive Wiki

FIX: SHOW GETS Does Not Clear List Box on Empty Record

ID: Q105587

2.50 WINDOWS kbprg kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FoxPro for Windows, version 2.5


The SHOW GETS command does not clear a list box when a SET FILTER command is used to simulate a parent-child relationship.

This behavior occurs only when you are moving from a record in the "parent" database that has a matching "child" record to a parent record that does not have a matching child record. The list box displaying the child record should clear, but instead continues to display the previous values.


Microsoft has confirmed this to be a problem in FoxPro 2.5 for Windows. This problem was corrected in FoxPro 2.5a for Windows.


Steps to Reproduce Problem

NOTE: In the following program, a filter is set on the INVOICES database in order to display the INO field for all INVOICES related to the current customer.

1. Create and run a program with the following code:

      CREATE TABLE customer (cno C(5), contact C(35))
      CREATE TABLE invoices (ino N(4), cno C(5))

      INSERT INTO customer (cno, contact) VALUES ;
         ('10000', '1st Computers')
      INSERT INTO customer (cno, contact) VALUES ;
         ('20000', 'A. Arts Computers')
      INSERT INTO customer (cno, contact) VALUES ;
         ('30000', 'Balance Computing Systems')

      INSERT INTO invoices (ino, cno) VALUES ;
         (1111, '10000')
      INSERT INTO invoices (ino, cno) VALUES ;
         (3333, '30000')

      SELECT customer
      GO TOP
      SELECT invoices
      SET FILTER TO invoices.cno = customer.cno
      *   (The filter controls what appears in the list box.)
      SELECT customer

      DEFINE WINDOW test ;
         FROM 0, 0 ;
         TO 10, 60

      DEFINE POPUP lpop ;
         PROMPT FIELD invoices.ino ;
         SCROLL ;


      @ 1, 1 SAY "Customer# "
      @ 1, 13 GET customer.cno ;
         SIZE 1,5 ;
         DEFAULT " "

      @ 2, 1 SAY "Contact"
      @ 2,13 GET ;
         SIZE 1, 35 ;
         DEFAULT " "

      @ 4,30 GET x ;
         PICTURE "@*HN next" ;
         SIZE 2,14,1 ;
         DEFAULT 1 ;
         VALID xval()

      @ 4,7 GET y ;
         PICTURE "@&N" ;
         POPUP lpop ;
         SIZE 4, 15 ;
         DEFAULT " "


      FUNCTION xval
      SELECT customer
      SELECT invoices
      GO TOP     && Move record pointer to update filter in INVOICES.
      SHOW GETS  && This doesn't always properly refresh the list box.

   Note that the first Customer#, "10000," and Contact, "1st
   Computers," are displayed, along with the matching Invoice number,
   "1111," in the list box.

2. Choose the Next button. The next Customer#, "20000," and Contact,

   "A. Arts Computers," display, but the invoice number is still
   '1111.' The expected behavior is for the list box to clear.

3. Choose the Next button again. The last Customer#, "30000," and

   Contact, "Balance Computing Systems," display along with the
   matching invoice number, "3333."

Additional reference words: FoxWin 2.50 buglist2.50 fixlist2.50a empty KBCategory: kbprg kbfixlist kbbuglist KBSubcategory: FxprgGeneral Solution Type : kbfix

Last Reviewed: October 14, 1997
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.