If I understand your question here's a quick way to achieve what's you're looking for.
Have 3 Text boxes on the screen
Text1.Text Text2.Text and Text3.Text
Numeric Values go into all boxes but for the first box you
would add the symbol of the operation you want and then when you move out of Text2.Text this will calculate your problem into Text3.Text
Text1.Text
Example: 25 +
Text2.Text
40
Text3.Text
65
Private Sub Text2_LostFocus()
If Val(Text1.Text) %26gt; 0 And Val(Text2) %26gt; 0 Then
FNum = Val(Text1.Text): SNum = Val(Text2)
If InStr(Text1.Text, "+") %26gt; 0 Then Text3.Text = FNum + SNum
If InStr(Text1.Text, "x") %26gt; 0 Then Text3.Text = FNum * SNum
If InStr(Text1.Text, "-") %26gt; 0 Then Text3.Text = FNum - SNum
If InStr(Text1.Text, "/") %26gt; 0 Then Text3.Text = FNum / SNum
End If
I hope this helps you......Owl
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment