I'm using three sets of listboxes, textboxes, and a commandbutton for each textbox.
The PROBLEM:
I can enter a value in the textbox, click the commandbutton and the listbox populates. BUT if I select an item from the listbox and then try to change the value of the textbox that decides what is in the same listbox the code ERRORS.
Could not get the list property. Invalid array index. It then highlights one of the three lines below for example:
UserForm1.Frame2.ListBox2.List(UserForm1.Frame2.ListBox2.ListIndex)
Private Sub ListBox2_Change()
TextBox.Text = ""
TextBox.Text = UserForm1.Frame2.ListBox2.List(UserForm1.Frame2.ListBox2.ListIndex)
End Sub
Private Sub ListBox3_Change()
TextBox.Text = ""
TextBox.Text = UserForm1.Frame1.ListBox3.List(UserForm1.Frame1.ListBox3.ListIndex)
End Sub
Private Sub ListBox4_Change()
TextBox.Text = ""
TextBox.Text = UserForm1.Frame3.ListBox4.List(UserForm1.Frame3.ListBox4.ListIndex)
End Sub
Any thoughts?
Thanks,
John
The PROBLEM:
I can enter a value in the textbox, click the commandbutton and the listbox populates. BUT if I select an item from the listbox and then try to change the value of the textbox that decides what is in the same listbox the code ERRORS.
Could not get the list property. Invalid array index. It then highlights one of the three lines below for example:
UserForm1.Frame2.ListBox2.List(UserForm1.Frame2.ListBox2.ListIndex)
Private Sub ListBox2_Change()
TextBox.Text = ""
TextBox.Text = UserForm1.Frame2.ListBox2.List(UserForm1.Frame2.ListBox2.ListIndex)
End Sub
Private Sub ListBox3_Change()
TextBox.Text = ""
TextBox.Text = UserForm1.Frame1.ListBox3.List(UserForm1.Frame1.ListBox3.ListIndex)
End Sub
Private Sub ListBox4_Change()
TextBox.Text = ""
TextBox.Text = UserForm1.Frame3.ListBox4.List(UserForm1.Frame3.ListBox4.ListIndex)
End Sub
Any thoughts?
Thanks,
John