Hi, I have a ListBox on a form. The listBox is populated by a range, then an item "New Event" is added to the end of the list.
When "New Event" is selected, I would like an input box to be shown to the user. Then the InputBox's information "NewEvent" will be added to the top of the ListBox's list. I would like the new entry, "NewEvent", to be show to the user as the newly selected item in the ListBox.
Currently I am having trouble getting the new item to be shown as if it is selected. I have 3 lists on the same form, and the other 2 show a blue highlight over the item that has been selected by the user. I would like the same "blue highlight" to be shown on the "NewEvent" after it has been added to the list.
Any Help would be GREATLY appreciated.
This is what I have so far:
When "New Event" is selected, I would like an input box to be shown to the user. Then the InputBox's information "NewEvent" will be added to the top of the ListBox's list. I would like the new entry, "NewEvent", to be show to the user as the newly selected item in the ListBox.
Currently I am having trouble getting the new item to be shown as if it is selected. I have 3 lists on the same form, and the other 2 show a blue highlight over the item that has been selected by the user. I would like the same "blue highlight" to be shown on the "NewEvent" after it has been added to the list.
Any Help would be GREATLY appreciated.
This is what I have so far:
Code:
Private Sub SELECTEVENT_Click()
'______add new event to list
Dim NewEvent As String
If SELECTEVENT.Value = "New Event" Then
SELECTEVENT.RemoveItem (SELECTEVENT.ListIndex)
SELECTEVENT.AddItem "New Event"
NewEvent = Application.InputBox("Please enter name of New Event.", _
"New Event", Left:=1, Top:=1)
If Not NewEvent = "False" Then
If NewEvent <> "" Then
SELECTEVENT.AddItem NewEvent, 0
End If
End If
End If
End Sub
Last edited: