mulitple calculation in one text box under form

seanyeap

Registered User.
Local time
Today, 23:36
Joined
Dec 26, 2003
Messages
12
Dear all,
I need to know if mulitple calculation can be made in one text box under form? Something like excel:- sum((10+20)-5). Thanks in advance.

Regards,
Sean
 
What exactly do you need? The sum function is an aggregate function in Access for use in queries, you cannot use it in the controlsource of a textbox.
 
dcx693 said:
What exactly do you need? The sum function is an aggregate function in Access for use in queries, you cannot use it in the controlsource of a textbox.

:confused: =Sum([SomeField]) ?
 
Darn it. Thanks Rich! I should stop posting messages early in the day. :D
 
You still have some Holiday spirit left inside you, same as me because I think we've both got it wrong. I think sean's looking for the Eval function on reflection :confused:
 
Well, we'll have to wait for him to write back and let us know what he really meant. :)
 
Dear guys,
Thanks for your feedback. Actually,you can refer to my attachment for easy understanding on my problem. My concern is how do i get total price from the in/out inventory? I guess it is clear now. Or you can suggest any methods as long as I can get the total in the form as well as in the table. Thanks a lot.

Regards,
Sean
 
Hi Sean,

Get your form in Design View.

Right-Click on the quantity field, choose properties and
look at the event tab. The AfterUpdate event fires every
time that you update the quantity field. In this case it
calculates the price. Experiment with it.

Notes:

You should not really store the total, because you can
calculate it easily (as shown). You can also easily calculate
the total in queries for your forms/reports. Storing values
like this will bring you trouble in the future. You can't always
assume that your stored value is in "synch".

You should not use Spaces or special symbols ("/") in your
field and table names. In most cases you can get away
with it by using [brackets] around the name, but its best
to just stay away from them.

Experiment with the Events that you see in the properties.
Experiment with making some queries to look at your data.

hth,
Wayne
 

Attachments

Dear Wayne,
Thanks for solving my problem partially. No doubt that I can get the total when "qty in/out" is keyed in. What if I have multiple ins and outs to be keyed in. For example:- at first 10 "in" then 5 "in" then 4 "out"? The answer for total will be like qty:11*price per pc. Right?
Or any other ways? Thanks.

Regards,
sean
 
Dear All,
Ok,now I get the total when "qty in/out" is keyed in the form. What if I have multiple ins and outs to be keyed in. For example:- at first 10 "in" then 5 "in" then 4 "out"? The answer for total will be like qty:11*price per pc. Right? Or you can suggest any methods as long as I can get the total in the form as well as in the table. Thanks a lot. Pls refer to the attachment for easy understanding.

Regards,
Sean
 

Attachments

Users who are viewing this thread

Back
Top Bottom