Solved Using a textbox as a calculator (1 Viewer)

Sun_Force

Active member
Local time
Today, 21:24
Joined
Aug 29, 2020
Messages
396
Maybe I'm expecting too much of Access, or simply I'm lazy to do the calculation, but is there any way to make a textbox does a simple calculation?
For example if I type 3 * 3 * 10 and press enter, the after update event change the content to 90.

Or if I type 26.4 / 3, change it to 8.8

Thanks.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:24
Joined
May 7, 2009
Messages
19,175
on afterUpdate event of your textbox:

private sub textbox1_afterupdate()
me!textbox1 = eval(me!texttbox1)
end sub
 

Sun_Force

Active member
Local time
Today, 21:24
Joined
Aug 29, 2020
Messages
396
Thanks. Hadn't heard about eval.
 

Users who are viewing this thread

Top Bottom