ARampton
asked on
Access Combo Box AutoSelect content on Click
I want to automate what is achieved by double clicking in a combo box ProjectNumberFind with VB code so the visible content is selected and will then get replaced by what a user next types
I find selecting the contents of Text Boxes speeds data entry by using OnClick but can't make it work with my Combo Box
Me.Form.ProjectNumberFind. SelStart = 0
Me.Form.ProjectNumberFind. SelLength = Len(Me.Form.ProjectNumberF ind.Text)
Me.ProjectNumberFind.SetFo cus achieves what I want when triggered from another location but I can't find any way of making the cursor auto select my Combo Box without double clicking
I find selecting the contents of Text Boxes speeds data entry by using OnClick but can't make it work with my Combo Box
Me.Form.ProjectNumberFind.
Me.Form.ProjectNumberFind.
Me.ProjectNumberFind.SetFo
If you teach people to tab through the controls rather than clicking, you won't need any code at all. each will be selected automatically.
ASKER
Tried that but it does not work in Access 2010 forms with a Combo Box
Try it in the MouseUp event. You may also need to refer to the Column of the Combo:
Me.YourCombo.SelLenght = Len(Me.YourCombo.Column(1) )
Assuming the second column in your combo contains the text shown in the combo.
Me.YourCombo.SelLenght = Len(Me.YourCombo.Column(1)
Assuming the second column in your combo contains the text shown in the combo.
ASKER
I can't get Me.YourCombo.SelLenght = Len(Me.YourCombo.Column(1) ) to work
Tried using Me.YourCombo.SelStart = 0 & Me.YourCombo.SelLength = Len(Me.YourCombo) with OnMouseUp which does work but MouseUp is needed for normal operation of selecting an entry from the dropdown list so causes conflict when used
Tried using Me.YourCombo.SelStart = 0 & Me.YourCombo.SelLength = Len(Me.YourCombo) with OnMouseUp which does work but MouseUp is needed for normal operation of selecting an entry from the dropdown list so causes conflict when used
Then I think you're stuck ...
I've requested that this question be deleted for the following reason:
The question has either no comments or not enough useful information to be called an "answer".
The question has either no comments or not enough useful information to be called an "answer".
ASKER
I still need a smart way of enabling typing in ComboBox without double clicking
Has anyone else managed this?
Has anyone else managed this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
Your example seems to do just what I want, I was thinking it might need some form of counter to disable subsequent selection when one needs to use the combobox dropdown menu
I will try your process in my Database
Your example seems to do just what I want, I was thinking it might need some form of counter to disable subsequent selection when one needs to use the combobox dropdown menu
I will try your process in my Database
I've requested that this question be closed as follows:
Accepted answer: 500 points for als315's comment #a40768289
for the following reason:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Accepted answer: 500 points for als315's comment #a40768289
for the following reason:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
ASKER
Excellent solution
I was thinking of trying something similar myself but great to have someone who already knows a workable solution
I find it frustrating so many other experts think there is no way of achieving what you have proved works nicely
I was thinking of trying something similar myself but great to have someone who already knows a workable solution
I find it frustrating so many other experts think there is no way of achieving what you have proved works nicely
Me.YourCombo.SelStart = 0
Me.YourCombo.SelLength = Len(Me.YourCombo)