You can do this with the line:
KeyCode = 0
after you have tested it.
BTW, you are better to use the KeyDown event, as then you get autorepeat.
I've just pinched your idea and tried the above and it works very well. :-)
--
--
Rob McClean
"...a Saviour has been born to you in David's city, who is Christ the Lord."
The Holy Bible, Luke ch 2 v 11
Quote:
> I want to intercept a keypress for a specific control on my form, i.e.
> be able to detect the key, but not to have the key value passed along
> to the control.
> In this case I want to intercept the + and - keys on a date control to
> advance and move the date back, as in MS Money.
> I know how to create a Key_Up event and test for the keys I want to
> intercept. I will then programmatically increase or decrease the date
> currently displayed and update the value of the control.
> How do I keep the keys that I want to intercept from getting to the
> control and changing the data?
> E.g. Control box reads: 12/06/00
> User Presses +
> The program changes the value to 12/07/00 without it becoming "+"
> TIA
> Keith