Hi Everyone,
I have a combobox with 2 options "DISPOSED" and "IN USE", depending on the option chosen a listbox is populate with "Asset ID's". I have a button to delete the items in the listbox but i cant seem to get it working. The code is as follows.
Can someone see where i might be going wrong?
Nim
I have a combobox with 2 options "DISPOSED" and "IN USE", depending on the option chosen a listbox is populate with "Asset ID's". I have a button to delete the items in the listbox but i cant seem to get it working. The code is as follows.
Code:
Dim strSQL As String, List As ListBox, itm
Set List = Me!List236
If MsgBox("This Action Cannot be Reversed ,Do You Really Want to Delete Assets?", vbQuestion + vbYesNo) = vbYes Then
For Each itm In List.ItemsSelected
strSQL = "DELETE Asset_ID FROM tblAssets Where (Asset_ID)=" & List.ItemData(itm) & ";"
DoCmd.RunSQL strSQL
Next
Me.Requery
List.Requery
Set List = Nothing
MsgBox ("Assets have been deleted")
End If
Can someone see where i might be going wrong?
Nim