Requery Field on the form

rowfei

Registered User.
Local time
Today, 06:31
Joined
Feb 8, 2012
Messages
13
I have a drop down field " Product" on the form. Once a product is selected, the fee will be auto populated based on the calculation that I created on the query.

Now if the shipping fee is not free, the calculation will be the different. Therefore, I have created another calculation. And put the following codes on the After Upgrade event:

Me.Fee = Me.NoFreeShippingCal

But the correct fee won't updated on the Fee field. Under the Transaction_Fee field still shows the calculation with shipping free. Even I add the extra requery line.

Me.Fee = Me.NoFreeShippingCal
Me. Transaction_ID.requery

Thanks.
 
...on the After Upgrade event...

...Me. Transaction_ID.requery...

Sorry, but I find your post rather fuzzy!

What AfterUpdate event? If you're talking about the AfterUpdate event of the Field that is being Calculated, it will not fire when it's being populated through code, only if it is physically populated by keyboard or by pasting data into it. You would have to explicitly Call the event.

What is Requerying the Transaction_ID supposed to do? Transaction_ID does not sound like it is the name of a Calculated Field.

If a Calculation needs to be run again, in code, the Command to use would be Me.Recalc, not Requery.

Linq ;0)>
 
Sorry for the fuzzy post. Here is simplest way that I can explain my problem.

Filed: [Transaction Fee] = ([Price]+[Shipping])*.15. Once I enter the price, the transaction fee will auto cal since the default value for Shipping is 0.

However, when I changed the shipping from 0 to $15, the Transaction Fee won't recal.

Thanks,
 
Where, exactly, is

([Price]+[Shipping])*.15

placed?
  • In code in an event, such as the AfterUpdate event of Price Control?
  • In the Control Source of [Transaction Fee]?
  • Elsewhere?
Linq ;0)>
 
It's placed in an AfterUpdate even of Price.
 
Where, exactly, is

([Price]+[Shipping])*.15

placed?
It's placed in an AfterUpdate even of Price.

However, when I changed the shipping from 0 to $15, the Transaction Fee won't recal.

How could you expect changing data in the Shipping Control to cause the Calculation code in the Price AfterUpdate event to execute?

Place the same code that you have in the Price AfterUpdate event in the Shipping AfterUpdate event and you should be set.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom