After Update Code Help - Please

G

Guest

I have a field on a subform called AdvanceAmount. I need it to be a
calculated amount as follows, HOWEVER, I need to be able to manually override
the calculation. In either case, the underlying table record needs to be
filled in.

AdvanceAmount =
InvoiceAmount*(IIf(Advance_Percent<Debtors_AdvanceRate,Advance_Percent,Debtors_AdvanceRate)-AllowableDiscountPct)


All the above form fields are in the same subform as AdvanceAmount, except
Advance_Percent which is located in the main form.


I gather that to achieve my objective I need to code an AfterUpdate Event
Procedure for the component fields of the above formula but I'm not sure how
to do that. Could anyone give me the code required for each of the component
fields please ??

Thanks very much.
 
G

Guest

I don't think you need any code, just a change in the way you reference the
Advance_Percent field. Try this:

AdvanceAmount =
InvoiceAmount*(IIf(Me.Parent.Advance_Percent<Debtors_AdvanceRate,
Me.Parent.Advance_Percent, Debtors_AdvanceRate)-AllowableDiscountPct)

Barry
 
G

Guest

Thanks. But actually, the formula I am using works fine when I put it in the
the Control Source for the form field. The problem is that I can't manually
override it. I've been told that the only way to achieve this is to put
appropriate After Update Event Procedure code in the component fields of the
formula. But I'm not sure how to do that. Do you know ??

Thanks again.
 

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