P
pubdude2003 via AccessMonster.com
I have a simple calculation form wherein I would like to trap a "/", "*", "-"
or "+" then move the focus to the next control and then insert the trapped
keystroke... I have been using the code below but it is a bit 'blinky' always
tabbing but not always executing the second SendKeys, I guess as with all
SendKey code... you writes the code and you takes your chances.
Has anyone a bettter solution for me please?
Select Case KeyCode
Case 111, 191 'Divide
KeyCode = 0
SendKeys "{tab}"
SendKeys "/"
Case 106 'Multiply
KeyCode = 0
SendKeys "{tab}*"
Case 107 'Addition
KeyCode = 0
SendKeys "{tab}{+}"
Case 109, 189 'Minus
KeyCode = 0
SendKeys "{tab}{-}"
End Select
or "+" then move the focus to the next control and then insert the trapped
keystroke... I have been using the code below but it is a bit 'blinky' always
tabbing but not always executing the second SendKeys, I guess as with all
SendKey code... you writes the code and you takes your chances.
Has anyone a bettter solution for me please?
Select Case KeyCode
Case 111, 191 'Divide
KeyCode = 0
SendKeys "{tab}"
SendKeys "/"
Case 106 'Multiply
KeyCode = 0
SendKeys "{tab}*"
Case 107 'Addition
KeyCode = 0
SendKeys "{tab}{+}"
Case 109, 189 'Minus
KeyCode = 0
SendKeys "{tab}{-}"
End Select