1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'MS Access' started by allahditta, Dec 27, 2010.

  1. allahditta

    allahditta New Member

    Joined:
    Dec 27, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. apr pillai

    apr pillai New Member

    Joined:
    Dec 17, 2010
    Messages:
    16
    Likes Received:
    12
    Trophy Points:
    0
    Occupation:
    Auditor
    Location:
    India
    Home Page:
    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.
     

Share This Page