Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Calculation Code

Posted on 2002-05-08
2
Medium Priority
?
126 Views
Last Modified: 2010-05-02
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
0
Comment
Question by:piratepatrol
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 200 total points
ID: 6997295
easy:

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
0
 
LVL 3

Author Comment

by:piratepatrol
ID: 6997314
I LOOOOOOOOOOOVE YOU - whoever you are!  :)  Thank you so much.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question