Discussion Locked

USING VB 6.0 DATACOMBO LIST BOX

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How do i remove the selected value from a datacombo list box based on the index value selected?

Say my dcListbox holds the values:
dcListb.list(index1) = 015
dcListb.list(index2) = 016
dcListb.list(index3) = 017
If during run time the user selects index2 ie(016)
i wish to code a button click_event to removed the value in the list that is selected.

1 reply

by ba_ss

I may be half understanding your question or problem here, but here's something to try.
.................................................
Write you a procedure named "UpdateList". The code
contained within it will simply be this for all indexes
If dcListb.list = True Then
dcListb.list(index2)= " "
dcListb.DataField.Refresh
dcListb.RecordSet.Refresh
End If
If this don't do it use the RemoveItem method
................................................
Now within the code window of the cmd_Click
you simply invoke the UpdateList procedure.
This code should test to see if an index is selected, and depending on which one selected proceed to clear it and refresh your control and data sources.

This discussion is closed to new replies.