While I agree with JohnYingling on the necessity of vallidation checks before attempting to 'do the math', I know of no reason to implement/instantiate the resource expensive KeyPress event. It should be sufficient to check each of the source textboxes as "IsNumeric". Further, it should be fairly simple to create an option group for the operation [ "+" | "-" | "*" | "/" | "\" | ... "mod"] and use a simple select statement to perform single operations on the (Validated) values entered with the selected operator. At least conceptually, one should be able to build fairly complex statements using such an approach.
Since we cannot post forms here, I cannot show this "in action", however I have implemented a brief subset of the concept and it does work.
MichaelRed
mred@att.net
There is never time to do it right but there is always time to do it over