Pls help me with my problem with this code. I have 2 textbox in my form, named list1 & list2, and i have one button. I want it that every time I click the button the value of list1 & list2 will appear in listview. The problem with this code is it come up with an errow "SUBSCRIPT OUT OF RANGE".
Private Sub child_add_Click()
Dim x(1 To 50)
list.View = lvwReport
list.ColumnHeaders.Add , , "Name:"
list.ColumnHeaders.Add , , "Birthdate:"
With list
For i = 1 To UBound(x)
.ListItems(i).ListSubItems.Add i, , x(i)
Next
End With
End Sub
Last edited by TcM; 02-08-2008 at 07:06 AM. Reason: !!!!Code Tags!!!!
I tried this code in VB 6.0, but it seems like VB.NET?
and please use the code tags!
Why did you use an array?
Do you mean this...
Code:Dim lview as ListItem list.View = lvwReport list.ColumnHeaders.Add , , "Name:" list.ColumnHeaders.Add , , "Birthdate:" With list Set lview = .ListItems.Add(,,,list1.Text) lview.Subitems(1)=list2.text end with set lview=nothing
regards,
jireh
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks