>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?
* txtOrderID.Valid thisform.lstmyList.Requery() * Listbox.init With This .RowSourceType = 3 && SQL .RowSource = ; 'Select pr.prod_name, oi.Quantity, oi.unit_price, '+; ' oi.line_no, o.cust_id, o.order_id '+; ' from orders o '+; ' inner Join orditems oi On o.order_id = oi.order_id '+; ' inner Join products pr On pr.product_ID = oi.product_ID '+; ' where Val(o.order_id) = Thisform.txtOrderID.Value '+; ' order By oi.line_no '+; ' into Cursor crsOItems' .ColumnCount = 4 .ColumnWidths = "150,100,100,50" .MultiSelect = .T. Endwith * command button click *Confirm deletion - assuming no buffer for simplicity With Thisform.lstMyList Select crsOItems Scan For .Selected(Recno()) Delete From ordItems ; where order_id = crsOItems.order_id And ; line_no = crsOItems.line_no Endscan .ListIndex=0 .Requery EndwithPS: You could do this easier with Foxyclasses' MultiSelectGrid and Moverlist classes.