It the Total text box is not bound to a field in the record source (which
would be correct because calculated values should not be stored in tables),
then you can put the correct formula in the Control Souce property of Total.
= Me.wt * me.qty
If you are incorrectly storing this value in a table, go to confession, say
3 Hail Marys, and do it this way.
Put the following in the After Update event of both wt and qty:
Me.Total = IIf(IsNull(Me.wt) Or IsNull(Me.qty), Null, Me.wt * Me.qty)
Bon43 said:
So I added this to the text box field: =(sum(me.[wt])*(me[Qty])). When I
push enter, the #name? comes up. Sorry to be a pain - i am a newbie and
perhaps this is not the way to perform this task. We had an old database that
I want to emulate - in that the operator can just enter the new qty and the
"total" field will automitically change right on the form. Then the operator
can print and he is done.
:
Me. or Me! is used in forms and reports and is an object reference to the
current form or report. For example if the form's name is frmClient, the
code in the form's module could be
Forms!frmClient!
But is more commonly written as
Me.
:
Thanks for replying. I truncated the field names for your benefit. They are
more intuitive than these. I have to ask, do i type in the word me. or is
that the form name i use, or what? thanks again
:
take of the sum.
Qualify your names Me.[pc], Me.[qty]
Also, try to use more meaningful names. Will you remember what they mean 6
months from now. How about the poor slob that inherits your app?
:
I am working on designing a form .I want to be able to have a text box field
called “total†calculate the weight times qty. One field remains static
and this has the weight of product in it “wtâ€. Another is the “Qty†field and
that changes. I created another fieldâ€Total†with the following formula
=(sum([pc])*([qty]). What is happening is, when I add another record, it is
calculating all records. How do I write a formula that will only include the
current record?
Thanks for your assistance.