Calculation Code

Hi friends,

I have two textboxes in my form.  I would like to be able to type in a math expression in box 1 and when I tab out of that box, I would like the result to show in box 2.  For example, if I type "9 - 5" in box 1 and tab out, I would like "4" to show up in box 2.  Is the code for this really hard?  Would somebody kindly share it with us?  

Thanks, friends.

Jazon Samillano
Jacksonville, FL
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

bobbit31Connect With a Mentor Commented:

under projects/references choose microsoft script control

then do:
Private Sub Command1_Click()
Dim scr As New ScriptControl

scr.Language = "vbscript"
Text2.Text = scr.Eval(Text1.Text)

End Sub
piratepatrolAuthor Commented:
I LOOOOOOOOOOOVE YOU - whoever you are!  :)  Thank you so much.
All Courses

From novice to tech pro — start learning today.