Equation in Textbox

B

billy_pit

Hi,
My project is in MS Access.
In that I have one form which, I am using for data entry.
In that I have one Textbox in which I want to enter like this
10*20+20*30+30*40
when I Lostfocus of that Textbox than in that same textbox I want the
result of this equation like
2000
Its simple I think so, but I don't know how to do it.
Thanks
 
A

Allen Browne

Use Eval().

For example, you could have it write the value to another text box named
Text1, like this:
Me.Text1 = Eval(Me.Text0)

(Note that the text box where the user enters the expression cannot be bound
to a Number field.)
 
B

billy_pit

Use Eval().

For example, you could have it write the value to another text box named
Text1, like this:
    Me.Text1 = Eval(Me.Text0)

(Note that the text box where the user enters the expression cannot be bound
to a Number field.)

--
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.






- Show quoted text -

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top