Listviews and keeping info on same line
Posted on 1998-10-12
This is the code I use to get my listview populated from just the text boxes on the page this has nothing to do with databases just moving info in text boxes to listview:
Do While j < 8
If chksize(j).Value= 1 Then
Set Order= lvOrder.ListItems.Add(, ,cboNumber.Text)
lvOrder.ListItems.Add.SubItems(1) = strsize(j)
lvOrder.ListItems.Add.SubItems(2) = Val(txtQuantity(j).Text) & "@" & Format _ (sngprice(j), "Currency")
However, the problems with this is that it puts the four items that I want to add in the correct columns, but all on different lines. I have tried _ and + and ; but
none of them work. It doesn't put all i want on one line, it puts the four things on four different lines but in the correct columns, can you tell me how to do this please????
Also, above, strsize(j) and sngprice(j) come from the sub procedure when I load the file they are in. I get an error because they are not declared, but when I declare them, it still doesn't work, so I assume that in the above sub
procedure I need to do something like
Private Sub Add_To_Order_Click( strsize(j), sngprice(j)) or something like that to identify that it is getting called from another procedure, but that doesn't seem to work. I am sorry for all the questions, but I don't what to do??