Running total on Main from from Value on Subform
Posted on 2014-03-05
I have tried various methods without success.
I have a field MainForm.txtMCFPaidUS ( this should be the running total and automatically update if the value in the subform.NetAmount changes.
I have tried txtMCFPaidUS.value = subform.NetAmount
strSQL = "SELECT Sum(NetAmount) AS NetTotalUS" & _
" FROM tblinvoice" & _
" GROUP BY tblinvoice.ContractNumber" & _
" HAVING (((tblinvoice.ContractNumber)=GetgContract()))"
Set rs = curDB.OpenRecordset(strSQL)
Me.txtMCFPaidUS = rs("NetTotalUS")
get error value enter is not valid for this field.
what is the best method to have an up to date value of the total of NetAmount displayed on the Main form.