Solved

Math with textbox text

Posted on 2003-11-10
2
316 Views
Last Modified: 2010-05-03
Hi, I want to know how to do this: I write for example, "1+1" in a textbox, and when I press a button, the text turns into 2. And just like that, if I write "3+3" it says 6, if I write "6*2" it says 12... is there any way of doing that? Thanks!
0
Comment
Question by:HyMaX
2 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 30 total points
Comment Utility
easiest way is to use ms script control (under project/references) then do:

Dim scr As New MSScriptControl.ScriptControl
scr.Language = "VBScript"
MsgBox scr.Eval(Text1.Text)
0
 

Author Comment

by:HyMaX
Comment Utility
Perfect, thanks!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now