Hi Experts ,
I search for sombody to help me for my problem !
I make new project when fill data in textboxes and comboxes and click commandbutton then will copy to listbox , but I want in first column in listbox should autonumber 1,2,3.. evrey time when copy to listbox , but just show 1 for the first row and when copy data more to listbox will be empty in first column (to more understand just try filling field textboxes and combobox and copy more than one time will note the problem) .
here is the code
Private Sub AddToList_Click()
Dim i As Long
For i = 1 To 3
If Me("textbox" & i) = "" Then
MsgBox Me("label" & i).Caption & " is missing", vbCritical: Exit Sub
End If
Next
With Me.ListBox1
.ColumnCount = 5
.ColumnWidths = "80;100;80;80;80"
.AddItem
.List(.ListCount - 1, 1) = Me.ComboBox1
.List(.ListCount - 1, 2) = Me.TextBox1.Value
.List(.ListCount - 1, 3) = Me.TextBox2.Value
.List(.ListCount - 1, 4) = Me.TextBox3.Value
.List(lindex, 0) = lindex + 1
For i = 0 To .ListCount - 1
.List(i, 2) = Format(.List(i, 2), "#,##0.00")
.List(i, 3) = Format(.List(i, 3), "#,##0.00")
.List(i, 4) = Format(.List(i, 4), "#,##0.00")
Next i
End With
End Sub
thanks