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
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