I have a mainform with a field that is the total of a column of a subform. I use the following code to update the field in the mainform in the after update event of the subform. After the update of the field on the main form I want to do an add new record in the subform. The problem is the add new record is not being executed. If I debug and step throiugh the code it does the add new record but when I run the form it skips the add new record. If I comment out the call it does the add new record.
Thanks in advance,
John
' sql statement that totals column on subform
Call calcRunTime
' Set field on record in mainform = to calculated value
strSql = "UPDATE tblProduction SET tblProduction.
[RunTime] = " & strQuote & RunTime & strQuote & " " _
& "WHERE tblProduction.[ReferenceId] = " & [Forms]![frmproduction]![ReferenceId]
CurrentDb.Execute strSql
DoCmd.GoToRecord , , acNewRec
Thanks in advance,
John
' sql statement that totals column on subform
Call calcRunTime
' Set field on record in mainform = to calculated value
strSql = "UPDATE tblProduction SET tblProduction.
[RunTime] = " & strQuote & RunTime & strQuote & " " _
& "WHERE tblProduction.[ReferenceId] = " & [Forms]![frmproduction]![ReferenceId]
CurrentDb.Execute strSql
DoCmd.GoToRecord , , acNewRec