G
Graeme at Raptup
Hi,
I have a main form: NewSupplier
with a subform: NewPricing Subform
On the main form are two controlsiscount and VAT Registered
On the subform are two controls: DiscountPrice and NewSupplierPrice that I
want to reference so that the respective tables are updated.
I have the following as an event on the Discount control:
Private Sub Discount_BeforeUpdate(Cancel As Integer)
Me![NewPricing Subform].Form![Discount Price] = ((1 - (Me.[Discount])) *
Me![NewPricing Subform].Form!STDCost)
Me![NewPricing Subform].Form![NetSupplierPrice] = IIf(Me.[VAT Registered] =
True, ([NewPricing Subform].Form![Discount Price] * 1.14), [NewPricing
Subform].Form![Discount Price])
End Sub
What seems to happen is that only the first row of the subform is updated
for each Supplier on the main form.
As always, any help is greatly appreciated!
PS:Ultimately what I want to achieve is to use these 'stored' (bound)
controls to enter a value in their respective table fields. The reason that I
need to do this (rather than just using a simple query calculation or a
standard calculated control) is because these values are referred to in other
forms and queries and I can then use the fields for other calculations.
I have a main form: NewSupplier
with a subform: NewPricing Subform
On the main form are two controlsiscount and VAT Registered
On the subform are two controls: DiscountPrice and NewSupplierPrice that I
want to reference so that the respective tables are updated.
I have the following as an event on the Discount control:
Private Sub Discount_BeforeUpdate(Cancel As Integer)
Me![NewPricing Subform].Form![Discount Price] = ((1 - (Me.[Discount])) *
Me![NewPricing Subform].Form!STDCost)
Me![NewPricing Subform].Form![NetSupplierPrice] = IIf(Me.[VAT Registered] =
True, ([NewPricing Subform].Form![Discount Price] * 1.14), [NewPricing
Subform].Form![Discount Price])
End Sub
What seems to happen is that only the first row of the subform is updated
for each Supplier on the main form.
As always, any help is greatly appreciated!
PS:Ultimately what I want to achieve is to use these 'stored' (bound)
controls to enter a value in their respective table fields. The reason that I
need to do this (rather than just using a simple query calculation or a
standard calculated control) is because these values are referred to in other
forms and queries and I can then use the fields for other calculations.