copying data 4m an unbound textbox to field of a table

allahditta's Avatar
Newbie Member
salam to all!
i have a form named supplies containing a subform supplied product details.in a subform i hav different products supplied by a supplier.the total amount for each product is obtained by[total]=[unit price]*[quantity].i had also added the sum of all total of products on a subform n then displayed the total amount of all products supplied to an unbound textbox of a main form.
now i want this value to be stored in a field of a table 4m that unbound textbox as well coz i want to apply further queries upon it to find monthly supplies.
regards
0
apr pillai's Avatar, Join Date: Dec 2010
Go4Expert Member
The Products appearing on the Sub-Form are related to the Supplier record on the main form. The products value summary is calculated in the footer of the sub-form.

You may create a command button on the main form and on the button click event procedure you may write an expression to add the total to the supplier amount field of the current record with the following expression:

Code:
Private Sub Command0_Click()
       me![SupplierAmount] = me![SupplierAmount] + me![productsAmount]
End Sub

Make changes in the above code for proper object references.