Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete a Row in a List Box

Status
Not open for further replies.

MattBeas

Programmer
Nov 15, 2001
17
GB
Hi,

Can anyone help!

I am trying to delete a row out of a listbox when you select the row then click the a button. The Listbox is unbound and has values in it selected from a combo box.

Any help would be much appreciated!

Thanks
 
All you need to do is to redefine the rowsource of the listbox after you click the button. Try something like following code:

***
listbox.rowsource="select lastname from tblcustomers where 1=3"
listbox.rowsource="select lastname from tblcustomers"
***

Seaport
 
Can't really see how that would work. Looks to me like it is only changing the rowsource from showing a particular record to showing all records.

You would need to use the RemoveItem method of the listbox object, e.g. ListBox1.removeItem x, where x is the index of the item to be removed. This will remove it from the listbox. Have fun! :eek:)

Alex Middleton
 
What I means is that the rowsource of the listbox is the tblcustomers. After you delete a row from the tblcustomers, the above code will refresh the listbox to show that one row is deleted.

Seaport
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top