General discussion

Locked

USING VB 6.0 DATACOMBO LIST BOX

By canzee2000 ·
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.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by ba_ss In reply to USING VB 6.0 DATACOMBO LI ...

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.

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums