S S P P Member Apr 18, 2025 #1 Deselect a Lixtbox when textbox receives focus I click on the New button and the textbox receives focus. I need the textbox to deselect the listbox when it receives focus. Attachments Deselect a Lixtbox when textbox receives focus.xlsm 22.6 KB · Views: 6
Deselect a Lixtbox when textbox receives focus I click on the New button and the textbox receives focus. I need the textbox to deselect the listbox when it receives focus.
Belleke Well-Known Member Apr 18, 2025 #2 As always, your example sucks Play with the following Code: LBx1.ListIndex = -1
S S P P Member Apr 18, 2025 #3 I already tried it doesn't work Private Sub LBx1_Change() TBx1 = LBx1.List(LBx1.ListIndex, 0) End Sub
I already tried it doesn't work Private Sub LBx1_Change() TBx1 = LBx1.List(LBx1.ListIndex, 0) End Sub
S S P P Member Apr 18, 2025 #4 I got it like this Private Sub LBx1_Click() For i = 0 To LBx1.ListCount - 1 If LBx1.Selected(i) Then TBx1 = LBx1.Value Exit For End If Next End Sub Excludes Private Sub LBx1_Change() TBx1 = LBx1.List(LBx1.ListIndex, 0) End Sub
I got it like this Private Sub LBx1_Click() For i = 0 To LBx1.ListCount - 1 If LBx1.Selected(i) Then TBx1 = LBx1.Value Exit For End If Next End Sub Excludes Private Sub LBx1_Change() TBx1 = LBx1.List(LBx1.ListIndex, 0) End Sub