Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MS Access (http://www.go4expert.com/forums/ms-access-forum/)
-   -   copying data 4m an unbound textbox to field of a table (http://www.go4expert.com/forums/copying-data-4m-unbound-textbox-field-t24281/)

allahditta 27Dec2010 14:22

copying data 4m an unbound textbox to field of a table
 
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

apr pillai 25Feb2011 00:10

Re: copying data 4m an unbound textbox to field of a table
 
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.


All times are GMT +5.5. The time now is 04:55.