Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing items in a listbox with a SQL source
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00832474
Message ID:
00832509
Views:
17
So I should delete the item from the cursor, update the table and then requery the table? Does the selected property in a listbox require you to iterate through the items? All the examples I see show that scenario.

Thanks

>The RemoveItem only works for RowSourceType 0 (None) or 1 (Value).
>
>>Hi all,
>>
>>I'm building a work order form that has a listbox on a pageframe that is populated with a SQL statement so that the items related to that order are the items in the list box. The user needs to be able to remove items from the order. I'm having problems getting this to work. This code is in the click event of cmdRemoveItem.
>>
>>LOCAL cSelectedItem
>>*** remove one item from this order
>>cSelectedItem = thisform.pgfPuDlvDetails.pagstop1.lstOrderItems.Selected
>>IF MESSAGEBOX("Are you sure you want to remove this item?", 292,;
>>	    "Please confirm removing this item") = 6
>>    IF cSelectedItem
>>         thisform.pgfPuDlvDetails.pagstop1.lstOrderItems.RemoveItem
>>    ENDIF
>>ENDIF
>>thisform.Refresh
>>DODEFAULT()
>>
>>I've tried variations on this and can't seem to get it to work. After it does work I need to update the underlying table and run the query again so the form is refreshed with the revised data. Where am I missing the point?
>>Using VFP8 with Codemine7.1 on W2Ksp4
>>TIA
Opportunity is missed by most people beacuse it is dressed in overalls, and looks like work --- Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform