03856me
Active Member
- Joined
- Apr 4, 2008
- Messages
- 297
I have a listbox on a userform that populates a textbox with the PO number when I click on a row in the listbox after scrolling through the list. The issue I am having is the textbox will not update IF I choose the 1st item in the list, it works for all other items. Is there something I have in my code that is causing this? Your help is greatly appreciated.
Code:
Private Sub POListBox_AfterUpdate() 'POPULATE TEXTBOX WITH P.O. CHOOSEN FROM LISTBOX
If Me.POListBox.ListIndex >= 1 Then
r = Me.POListBox.ListIndex
With Me
.POTextBox.Value = POListBox.List(r, 0)
End With
End If
Worksheets("PO").Range("poNumber1").Value = Me.POTextBox.Value 'copies the p.o. number to the excel worksheet
End Sub