An amount is entered in the main form, but I need the sum of entered disbursements (in subform) to equal the original amount. If totals don't equal, I need a popup. If totals equal, I need to save the record and enter a new one.
An amount is entered in the main form, but I need the sum of entered disbursements (in subform) to equal the original amount. If totals don't equal, I need a popup. If totals equal, I need to save the record and enter a new one.
Need a popup for what - a message?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes. A popup to indicate out of balance.
Would need code in an event (form close?) to compare values. These values involve aggregate calcs. Subform in continuous view. Textbox in form footer with controlsource: =Sum([amount field])
Then code:
IIf Me.maintextbox <> subformsumtextbox Then
MsgBox "Not in balance"
Else
DoCmd.Close
End If
referencing textbox in subform can be tricky. I always name subform container control different from the object it holds, like ctrDetails.
Me.ctrDetails.Form.txtSum
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.