Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to calculate a formula in a text box? 1

Status
Not open for further replies.

Hanss

Technical User
Feb 15, 2001
85
CH
I have an access form with:

text field "text1"
text field "result"
command button: "button"

If I enter "2 + 5" in text1 and press the button I would like VBA to put the answer: "7" in the result field.

This only puts the formula "2 + 5" in the result field:

Me.result = CStr(Me.text1)

Would really appreciate any help!

Hanss
Zurich
 
I'd use the Application.Eval method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
EVAL works. Thank you VERY much for your valuable help!

Hanss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top