I am attemtping to run a query from my command button that will delete the selected records that match the recordid(s) selected in a listbox.
I keep getting an "object required" error at "Set ctl = Me.lstCurrent.Column(1)
Dim db As DAO.Database
Dim ctl As Control
Dim varItem As Variant
Set db = CurrentDB()
Set ctl = Me.lstCurrent.Column(1)
For Each varItem In ctl.ItemsSelected
CurrentDB.Execute "DELETE * FROM tblSpecialty_by_SME WHERE recordid = " & ctl.ItemData(varItem)
Next varItem
Forms!frmSpec.Requery
Any ideas for how I could do this differently?
Thanks!
Toni