Guidon Mendoza
New member
- Local time
- Today, 22:56
- Joined
- May 3, 2021
- Messages
- 19
Hi, everyone!
I hope that someone of good heart can help me solve this.
I developed a platform for a HR company. On it, I give the user the option to add skills to a candidate. And to do that, I have a ComboBox control. Since I need to take actions depending on the keyboard (Return, Esc, Tab and the sort), I capture the keyboard. The case is that when BackSpace is used (event Form_Keydown), the value in the TextBox of the ComboBox is correct, but it does not show.
In this case the TextBox should say "Linu" which is the value in it (I traced it).
In the code, InputKey is a String that classifies the strocked key. In Buffer I save the value that should be displayed in the TextBox of the ComboBox. I used it to see that the value of Ctl (the ComboBox) is what should be, and it is.
Does anyone have a clue as to what is happening? (And hopefully a hint to the solution).
Thanks in advance!
G
I hope that someone of good heart can help me solve this.
I developed a platform for a HR company. On it, I give the user the option to add skills to a candidate. And to do that, I have a ComboBox control. Since I need to take actions depending on the keyboard (Return, Esc, Tab and the sort), I capture the keyboard. The case is that when BackSpace is used (event Form_Keydown), the value in the TextBox of the ComboBox is correct, but it does not show.
In this case the TextBox should say "Linu" which is the value in it (I traced it).
Code:
inputKey = GetKey(KeyCode, Shift)
Set Ctl = Screen.ActiveControl
Buffer = Ctl
Debug.Print "Antes " & Buffer
If Ctl.Name = "SkFlt" Or Ctl.Name = "SpFlt" Then
Select Case inputKey
Case "UpperTxt", "LowerTxt", "Txt"
Buffer = Buffer & Chr(KeyCode)
KeyCode = 0
Case "Back"
If Buffer <> "" Then
Buffer = Left(Buffer, Len(Buffer) - 1)
End If
Case Else
End Select
Debug.Print "After value " & Buffer
Ctl.Value = Buffer
In the code, InputKey is a String that classifies the strocked key. In Buffer I save the value that should be displayed in the TextBox of the ComboBox. I used it to see that the value of Ctl (the ComboBox) is what should be, and it is.
Does anyone have a clue as to what is happening? (And hopefully a hint to the solution).
Thanks in advance!
G