Select all text in a combobox when it is clicked (not as obvious as it may look)
In the Got Focus event I use:
If cmbClient.Value & "" <> "" Then
cmbClient.SelStart = 0
cmbClient.SelLength = Len(cmbClient.Value)
End If
That works fine if the user tabs to the combobox but not if they click it.
I tried putting the same code in the Click event of the combobox but it doesn't work.
Thanks,
Marty
In the Got Focus event I use:
If cmbClient.Value & "" <> "" Then
cmbClient.SelStart = 0
cmbClient.SelLength = Len(cmbClient.Value)
End If
That works fine if the user tabs to the combobox but not if they click it.
I tried putting the same code in the Click event of the combobox but it doesn't work.
Thanks,
Marty
Last edited: