i added an if statement to the NEXT and NEW record buttons in the main form. It goes to the next or new record if
main form - subform = zero (mainform minus subformTOTAL is equal to zero)
if not, it will message you to recheck your data. it does what its supposed to do if the current record in the subform has values, but if you happen to click to a new record in the subform (inadvernetly) without entering anything it would consider the subform as null, therefore it would not go to the new record.
Dim ANSWE As String
If Me.grandTOT = 0 Then
DoCmd.GoToRecord , , acNewRec
Else
ANSWE = MsgBox("TOTAL DOESN'T ADD TO 0, IGNORE?", vbYesNo, "LITTER BALANCE")
If ANSWE = vbYes Then
DoCmd.GoToRecord , , acNewRec
Else
Exit Sub
End If
End If
End Sub
grandTOT is Nz([BornAlive])-Nz([WeanNumber])-Nz([SplitNumber])+Nz([piglet].[Form]![Text44]))
text44 is =DSum("ptot","qrypiglet","SowIds = '" & [SowIds] & "'")
ptot is IIf(IsNull([Reason]=True),[PigNum],[PigNum]*-1)
I hope it makes sense. Thanks in advance!