RawlinsCross
Active Member
- Joined
- Sep 9, 2016
- Messages
- 437
Good day,
I have two userforms - the first has a listbox with the column count set at 5, the second a combination of textboxes, labels, and comboboxes that the user selects. When selection is complete and a button is clicked, the listbox on the first userform is updated with the choices - pretty simple right? Well, the listbox is updated correctly the first 4 of the 5 columns and I can't understand why it won't accept the last column.
Here's the code - I wonder if someone could lend some visibility here.
I have two userforms - the first has a listbox with the column count set at 5, the second a combination of textboxes, labels, and comboboxes that the user selects. When selection is complete and a button is clicked, the listbox on the first userform is updated with the choices - pretty simple right? Well, the listbox is updated correctly the first 4 of the 5 columns and I can't understand why it won't accept the last column.
Here's the code - I wonder if someone could lend some visibility here.
VBA Code:
Private Sub iSubmit_CLick()
Dim frm As Object
For Each frm In VBA.UserForms
If frm.Name = "WorkOrderGUI" Then
With frm.lbAttachments
.AddItem
'Checking for column count
MsgBox .ColumnCount 'Returns 5 so all good there
.List(.ListCount - 1, 0) = Me.lblItem
.List(.ListCount - 1, 1) = Me.cbDocType
.List(.ListCount - 1, 2) = Me.tbDescription
.List(.ListCount - 1, 3) = Me.tbPath
.List(.ListCount - 1, 4) = Me.cbJobTask 'Fails here (Invalid property value)
.BackColor = vbGreen
End With
End If
Next frm
End Sub