MS ACCESS 2010 ASSIGN a value in a subform to the main form (1 Viewer)

roelfk7

New member
Local time
Today, 18:18
Joined
Jun 27, 2015
Messages
6
Good Day all,

I have a subform with a control name sbfProductDetails and I want to have a unboud field (txtPartsTotal) on the subform, that calculates a total for parts, value to reference to a field (txtParts) on the mainform (QuoteDetail). This value needs to be used for further calculations.

So I have tried an event in the after update event on the field in the subform and on the after update event on the mainform without any luck, just a blank field

Here is what I have tried.

Private Sub txtParts_AfterUpdate()

Me.sbfProductDetails.Form!txtPartsTotal = txtParts

End Sub

Then I also want to know is possible to assign the value to field on a table. The table is used by the the main form

Any Help will be highly appreciated.
 

Ranman256

Well-known member
Local time
Today, 11:18
Joined
Apr 9, 2015
Messages
4,337
You did it backwards....
On the subForm, set the total to calculate the sum, in the footer.
It's source =sum([amt])
On the master form, the total field is,
=me.subform.form.txtTotal
 

roelfk7

New member
Local time
Today, 18:18
Joined
Jun 27, 2015
Messages
6
Hi Thanks Ranman256

Should I add the line like this as and after update event or as also under the source of the field on the main form

=me.sbfProductDetails.Form.txtPartsTotal
 

roelfk7

New member
Local time
Today, 18:18
Joined
Jun 27, 2015
Messages
6
OK thank you so much Ranman. I got it to work.
You are a STAR!!!
 

Users who are viewing this thread

Top Bottom