Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Listbox with multiselect deleting unselected items
Message
De
03/12/2003 13:36:17
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Listbox with multiselect deleting unselected items
Divers
Thread ID:
00855548
Message ID:
00855548
Vues:
67
I have a listbox set up with the rowsource as an SQL statement creating the cursor TmpHistory. When the user double-clicks on an item, or selects multiple items and clicks on a command button, the following code fires in the MoveToActive() method of the form:

***************************************************************
LOCAL lnNumberSelected

Thisform.lblNoSelected.Caption = "Returning Records To Active......Please Wait"

lnNumberSelected = 0
For nCnt = 1 to Thisform.lstHistory.ListCount
If Thisform.lstHistory.Selected(nCnt)
lnNumberSelected = lnNumberSelected + 1
Thisform.lstActive.Additem(Thisform.lstHistory.List(nCnt))
Select tmpHistory
Go nCnt
Thisform.DeleteHistory()
Endif
EndFor

Thisform.lstHistory.Requery()
Thisform.lstActive.Requery()

***************************************************************

DeleteHistory() Method

....
deletes records matching 'cjob' and 'cver' fields in tmpHistory
....

****************************************************************

It works great most of the time but every once in a while it removes some records that it shouldn't. I don't do any removeitem statements....just a requery when all in list has been processed.

Any ideas???
Thanks.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform