I am trying to delete the item I select in my listBox (named PartsListBox) out of my Access database. How do I reference an item selected in a listBox so the database can go look for that same value? I think my oFile2 variable script is incorrect (var oFile2 = PartsListBox.selectedIndex;)
var oDB = xfa.sourceSet.DataConnection3; var oFile = Hide1.Subform1.HoldFormID.rawValue; var oFile2 = PartsListBox.selectedIndex; var bFound = false; while(!oDB.isEOF()){ if(xfa.record.DataConnection3.ID.value == oFile && xfa.record.DataConnection3.PartNumbers.value == oFile2){ bFound = true; break; } oDB.next(); } if(bFound){ oDB.delete(); oDB.update();