I want to update my parent form controls from the results of the subform line totals so that people do not need to capture the results into the parent form where they are mandatory required manually.
I'm currently picking the totals from the subform into the parent form unbound controls by the use of the four codes below:
Now to move the values from the unbound controls in the parent form shown above to bound controls so that they part of the parent form inputed data , I use the four codes
But the above code has some disadvantages because sometimes users tend to forget to launch the code and so the data is not saved together with parent form , on the save button I tried to use the code below , but its failing.
Any idea how fix this problem
I'm currently picking the totals from the subform into the parent form unbound controls by the use of the four codes below:
Code:
=[sfrmstockinDetails Subform].[Form]![txtTotalTaxable]
=[sfrmstockinDetails Subform].[Form]![txtTotalcounting]
=[sfrmstockinDetails Subform].[Form]![txtvattaxation]
=[sfrmstockinDetails Subform].[Form]![txtgrandTax]
Now to move the values from the unbound controls in the parent form shown above to bound controls so that they part of the parent form inputed data , I use the four codes
Code:
Public Sub txttotlaLinesDetal_Click()
Me.totItemCnt = Me.txtTotalFinalCouunt
Me.totTaxblAmt = Me.txttotlaLinesDetal
Me.totTaxAmt = Me.txtvattax
Me.totAmt = Me.txtvattax + Me.txttotlaLinesDetal
End Sub
But the above code has some disadvantages because sometimes users tend to forget to launch the code and so the data is not saved together with parent form , on the save button I tried to use the code below , but its failing.
Code:
Private Sub CmdSaveDetails_Click()
Call txttotlaLinesDetal_Click
DoCmd.Save
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "frmstocksin"
End Sub
Any idea how fix this problem