Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
remove items from combo box
Name: samantha Date: January 27, 2009 at 11:33:10 Pacific OS: Windows XP Subcategory: C/C++
Comment:
hiya guys...
well i have 2 combo boxes. start_time and end_time. They both contain 26 times starting from 09:00:00 to 22:00:00. Depending on what time is chosen for the start time, i want times equal to it and less than it to be removed from the end_time combo box. This is actually for VB6.
this is the code i have so far: it works sometimes but at times shows 'invalid procedure calll or argument' error
Private Sub Command1_Click() Dim cbo_list_item As Integer cbo_list_item = -1
Do Until cbo_list_item = 27 cbo_list_item = cbo_list_item + 1 If cmb_Start_Times.Text >= cmb_End_Times.List(cbo_list_item) Then cmb_End_Times.RemoveItem (cbo_list_item) End If Loop End Sub
Name: shutat Date: January 29, 2009 at 11:21:47 Pacific
Reply:
Not sure if it's what you're after, but try the code below. combo1 is the start.
What event triggers the random proceedure error? Are you resetting combo2 (end time) prior to calculating new times?
Dim idx As Integer
Private Sub Combo1_Click()
idx = Combo1.ListIndex
End Sub
Private Sub Command1_Click()
Dim i As Integer
For i = idx To 0 Step -1
Combo2.RemoveItem i
Next i
Combo2.Text = IIf(Combo2.ListCount > 0, Combo2.List(0), "No data")
End Sub
Summary: Hi In my VB program i add items from a text file. The problem is in the text box i have serval pieces of information. One of the pieces is and Examboard Id which is the subject of this list box. When ...
Summary: hi everybody, Here is my pbs, i want to have 2 combo boxes on the form ,from which i can select the items i want...i.e i want to filter out 2 items in the combo box simultaneously...my system doesnt ...
Summary: A list box allows you only to choose from the items in the list. A combo box is like a list box but adds a text box. You have the option of either selecting an item from the list or entering something...