Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox with multiselect deleting unselected items
Message
From
03/12/2003 13:36:17
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Listbox with multiselect deleting unselected items
Miscellaneous
Thread ID:
00855548
Message ID:
00855548
Views:
66
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.
Next
Reply
Map
View

Click here to load this message in the networking platform