Delete Button Code!

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I want to put a delete button next to a listbox called "tbStableDescription"
What code would i use to delete its contents on that form?


Thanks in advance.........Bob Vance
 
To use the Key Press function (you could put it behind any other funtion if
you wanted

Private Sub tbStableDescription_KeyPress(KeyAscii As Integer)
If KeyCode = vbKeyDelete Then
On Error Resume Next
List1.RemoveItem List1.ListIndex
End If
End Sub


Hope this helps
 

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

Back
Top