Form listbox / table issue

hardrock

Registered User.
Local time
Today, 14:37
Joined
Apr 5, 2007
Messages
166
Hello all, I am trying to delete records from my table using selected records on my forms listbox. My code below doesn’t seem to work.. can anyone spot why?


MachineModel and Serial are both setup as strings. Thanks

Set ctl = Me.List0

For Each varItem In ctl.ItemsSelected

DoCmd.RunSQL "DELETE * FROM dbo_DBCustomerMachines WHERE MachineModel = " & Me.List.Column(0, varItem) AND Serial = " & Me.List.Column(1, varItem)

Next varItem
 
You are going to need to loop through the selected items in the list box. This article may give you some pointers.
 

Users who are viewing this thread

Back
Top Bottom