I have a continuous form with a combo box where the row source is a query. I have added the following code so that when I click in the combobox the all of the text is selected so that I can use MajP's FAYT.
This all works well, the issue is that sometimes I need to filter on part of the text in the combobox but the MouseUp code means that the whole of the ComboBox is always selected.
I wondered whether I could set it so that only the 1st click in the Combobox triggers the code and any subsequent clicks just put the cursor in the Combobox but I don't know how to set that up. Any suggestions on how I resolve this would be gratefully received, thank you.
Code:
Private Sub cbVarietyID_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
'This code is to highlight the combobox when it is clicked in
Me.cbVarietyID.SelStart = 0
Me.cbVarietyID.SelLength = Len(Me.cbVarietyID.Text)
End Sub
This all works well, the issue is that sometimes I need to filter on part of the text in the combobox but the MouseUp code means that the whole of the ComboBox is always selected.
I wondered whether I could set it so that only the 1st click in the Combobox triggers the code and any subsequent clicks just put the cursor in the Combobox but I don't know how to set that up. Any suggestions on how I resolve this would be gratefully received, thank you.