delete item from listbox

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
 
A

Al Borges

Hi:

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

Regards,
Al
 

Ask a Question

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.

Ask a Question

Top