sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,421
- Office Version
- 2016
- Platform
- Windows
I'm trying to find a way to clear a Combobox value if the delete key is pressed but it's not doing what I need.
What I want it to do is if the user presses the delete or backspace key just clear the Combobox value but what I have so far is clearing the Combobox automatically after every selection, regardless of any key being pressed - this is occurring when I select from the dropdown;
This is currently in the KeyPress event so surely it shouldn't delete the Combobox value after selecting an item?
What I want it to do is if the user presses the delete or backspace key just clear the Combobox value but what I have so far is clearing the Combobox automatically after every selection, regardless of any key being pressed - this is occurring when I select from the dropdown;
Code:
If KeyCode = 46 Then
Combo1.Value = ""
End If
End If
This is currently in the KeyPress event so surely it shouldn't delete the Combobox value after selecting an item?