delete item from listbox

  • Thread starter Thread starter adriany
  • Start date Start date
A

adriany

i'm using code below to del from listbox.
anyone know better and simple code do the same?

Dim cnCurrent As ADODB.Connection
Dim strDelete As String
Set cnCurrent = CurrentProject.Connection

strDelete = "DELETE * FROM query1 WHERE Index = " & _
lstAvailable.Value

cnCurrent.Execute strDelete

cnCurrent.Close
Set cnCurrent = Nothing
 
Hi:

You can use the Docmd.Runsql strDelete method... this involves less lines.

Regards,
Al
 
Back
Top