Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Flaky listbox
Message
De
18/11/1999 10:53:41
 
 
À
12/11/1999 12:10:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00290632
Message ID:
00292473
Vues:
35
<>

This appears to be a common problem when basing a listbox on a cursor that is updated (also happens with combos).

If you think about it, the listbox is pointing to a workarea that contains the cursor. When you rebuild the cursor from a query, there is no way to know which workarea the cursor is now in. We don't usually care if we work with the alias rather than the workarea number, but unfortunately the listbox does. The listbox can no longer access the selected table as it is no longer in the same workarea. You are quite right that it sometimes appears to work, but more often than not it will fail.

What you need to to do is 'disconnect' the listbox from the rowsource, perform the query and then reconnect:

lcOldRowSrc = thisform.pageframe.page2.listbox.rowsource

thisform.pageframe.page2.listbox.rowsource = chr(0)

select * from alias into cursor NewAlias

thisform.pageframe.page2.listbox.rowsource = lcOldRowSrc


Hope this explains what's going on.

Jason
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform