calculator on the form ?

  • Thread starter Thread starter peljo via AccessMonster.com
  • Start date Start date
P

peljo via AccessMonster.com

Does anybody know some referemce how to build a simple calculator on the form
?
 
Allen apparently read your question as being about a calendar rather than a
calculator. I poked around a bit and found the following:
http://www.worksrite.com/Calc.htm

Another choice that uses the Windows calculator is here:
http://www.byerley.net/Access2kCalcDemo.zip
I did not look at this in great detail, but as I understand it will allow a
value from the calculator to be entered into a field, which may be more than
you need, but I expect you can skip that part.

You can set up a hyperlink to Calc.exe (the Microsoft calculator), but it
will generate a warning when you attempt to open it. SetWarnings False does
affect this message. Allen Browne has code to open a hyperlink and skip the
warning message, which is of interest to me so I tried it, but it seems an
exe file (such as calc.exe) is going to generate an error message unless you
use something like the Windows calculator link above. However, Allen's code
may be of interest, so here is the link:
http://allenbrowne.com/func-GoHyperlink.html
 
Thanks for picking that up Bruce. Appreciated.

Another option for really simple needs, is to provide a text box where the
user can enter:
4 + 8 - 3
and use Eval([Text1]) in its AfterUpdate event to get a result.
 
Hi Allen,

I am interested to know the other option that you had mentioned on the text
box. I tried it out but can't get anything out of it.

Fel

Allen Browne said:
Thanks for picking that up Bruce. Appreciated.

Another option for really simple needs, is to provide a text box where the
user can enter:
4 + 8 - 3
and use Eval([Text1]) in its AfterUpdate event to get a result.


BruceM said:
Allen apparently read your question as being about a calendar rather
than a calculator. I poked around a bit and found the following:
http://www.worksrite.com/Calc.htm

Another choice that uses the Windows calculator is here:
http://www.byerley.net/Access2kCalcDemo.zip
I did not look at this in great detail, but as I understand it will allow
a value from the calculator to be entered into a field, which may be more
than you need, but I expect you can skip that part.

You can set up a hyperlink to Calc.exe (the Microsoft calculator), but it
will generate a warning when you attempt to open it. SetWarnings False
does affect this message. Allen Browne has code to open a hyperlink
and skip the warning message, which is of interest to me so I tried it,
but it seems an exe file (such as calc.exe) is going to generate an error
message unless you use something like the Windows calculator link above.
However, Allen's code may be of interest, so here is the link:
http://allenbrowne.com/func-GoHyperlink.html
 
confu-sed said:
I am interested to know the other option that you had mentioned on the
text
box. I tried it out but can't get anything out of it.
Another option for really simple needs, is to provide a text box where
the
user can enter:
4 + 8 - 3
and use Eval([Text1]) in its AfterUpdate event to get a result.

Provide an unbound text box where the user can enter an expression such as:
99 * 2

In its AfterUpdate event procedure use Eval() to calculate the expression,
and assign the result to where ever you need it. For example, if the unbound
text box is named txtCalc, and you want the result assigned to the Amount
field:
Me.Amount = Eval(Me.txtCalc)

Be sure to include error handling in case the user enters an expression that
is not valid.
 
Back
Top