strSQL = "DELETE * FROM MyTable WHERE KeyField=""" _
& Me.lbXXX.Value & """;"
CurrentDB.Execute strSQL
Me.lbXXX.Requery
You'll need to replace
MyTable with the name of the table
KeyField with the name of the field in the table corresponding
to the bound column in the listbox
lbXXX with the name of the listbox (*not* the name of the field
the listbox is bound to).
It's based on a query.
I'm sure I've done it with a "DoCmd" command (linking with the ID id the
listBox)
However I can't remember how to do that and have tried using
the recordset to delete the record. Again I just can't figure it out
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.