AfterUpdate only editing first record (1 Viewer)

VegMan

New member
Local time
Today, 09:36
Joined
Nov 19, 2018
Messages
6
Hi All,

I am very inexperienced on access but have set up a small database to assist with my business. I have an AfterUpdate event where when I alter a textbox on my main form it recalculates a column in a subform. It is working however it is only recalculationg the first record and not the whole form. I want to edit the "SpanishTransport" text box and then update the delivered price for every record.

Can anyone help ? Please see code below -

Private Sub SpanishTransport_AfterUpdate()

Forms![Home]![Spainavailability]![Delivered Price] = ((((((Forms![Home]![Spainavailability]![Box Price] * Forms![Home]![Spainavailability]![Quantity/Plt]) * Forms![Home]![margin]) + Forms![Home]![SpanishTransport]) / Forms![Home]![ExchangeRate]) + Forms![Home]![rhd]) + Forms![Home]![UKTransport]) / Forms![Home]![Spainavailability]![Quantity/Plt]


End Sub

Thanks,
 

Ranman256

Well-known member
Local time
Today, 04:36
Joined
Apr 9, 2015
Messages
4,339
If it affects every sub record, then the query in the subForm should be using it.
Just refresh the query: me.subform.form.requery

Don't update 1 sub record at a time.
 

Users who are viewing this thread

Top Bottom