Hi,
how to replace selected item in the listbox with the value in textbox?
Printable View
Hi,
how to replace selected item in the listbox with the value in textbox?
List1.List(List1.ListIndex) =
Code:Private Sub Command1_Click()
If List1.ListIndex <> -1 Then 'ensure an item is selected
List1.List(List1.ListIndex) = Text1.Text
End If
End Sub
after i select the item in listbox in form3, i clicked button that shows form5 with one textbox to enter the replacing value.After this i clicked button in form5 that should replace the value in the form3.listbox with the value form5.textbox..this is the code i used in the buttton event of form5.
but i gets an error "object required"...vb Code:
Form3.List1.list(List1.ListIndex) = Form5.Text1.Text
after i select the item in listbox in form3, i clicked button that shows form5 with one textbox to enter the replacing value.After this i clicked button in form5 that should replace the value in the form3.listbox with the value form5.textbox..this is the code i used in the buttton event of form5.
but i gets an error "object required"... pls help me outvb Code:
Form3.List1.list(List1.ListIndex) = Form5.Text1.Text
(List1.ListIndex) that would mean that List1 is on Form5... everywhere that you reference a control from another Form you have to preceed it with form name
Form3.List1.List(Form3.List1.ListIndex) = Form5.Text1.Text
thank you....its working