shabbaranks
Registered User.
- Local time
- Today, 15:02
- Joined
- Oct 17, 2011
- Messages
- 300
Hi Guys,
Im trying to delete values from a table based on the selected values of a listbox. The listbox values have a hidden column which related to the ID on the table to which I am trying to delete from (if that makes sense).
If I use the following code:
I get an error stating Object doesn't support this property or method.
I used another posts code to which it seemed they were doing exactly what I am doing - any ideas why its not working?
Thanks!
Im trying to delete values from a table based on the selected values of a listbox. The listbox values have a hidden column which related to the ID on the table to which I am trying to delete from (if that makes sense).
If I use the following code:
Code:
Set ctl = Me.Results_listbox
For Each varItem In ctl.ItemSelected
CurrentDb.Execute "Delete * FROM Table1 WHERE Table1.ID = " & ctl.ItemData(varItem)
Next varItem
I get an error stating Object doesn't support this property or method.
I used another posts code to which it seemed they were doing exactly what I am doing - any ideas why its not working?
Thanks!