Results 1 to 4 of 4
  1. #1
    mfmathes is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Location
    Virginia
    Posts
    5

    Amount in form needs to equal disbursements in subform

    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.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    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.

  3. #3
    mfmathes is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Location
    Virginia
    Posts
    5
    Yes. A popup to indicate out of balance.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 11-30-2011, 07:51 AM
  2. Replies: 5
    Last Post: 05-14-2011, 04:31 AM
  3. How to make my query not equal to...
    By katrinanyc926 in forum Queries
    Replies: 3
    Last Post: 12-08-2010, 11:27 AM
  4. Replies: 4
    Last Post: 01-27-2010, 12:39 PM
  5. Set Numbers equal to each other
    By ygu3 in forum Access
    Replies: 1
    Last Post: 07-16-2009, 07:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums