Results 1 to 5 of 5
  1. #1
    spacekowboy is offline Novice
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    17

    =Sum with a max amount

    Hi, how can I put a max amount on an =sum box on a report? Lets say: =Sum([Paid]) with a max amount of $250,000.00 - or less than or equal to



    Thanks

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe instead of an expression, you can use some VBA. Need to determine where to place the VBA by understanding where the unbound control resides within the report's structure. Header? Detail? Footer?

  3. #3
    spacekowboy is offline Novice
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    17
    It is in the Header

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    In the report's VBA module, there is an On Format section for each section. Select the Header from the lefthand puldown and the On Format from the right pull down within the VBA editor.

    Your VBA goes in the new sub procedure.

    Not sure what a max of 250K is all about but maybe an IF Then statement is in order. YOu could probably leave the expression in the textbox and simply use the .visible property or incorporate your expression into the VBA.

    If me.ControlName < 250000 then
    me.controlname.visble = True
    else
    me.controlname.visble = True
    end if

  5. #5
    spacekowboy is offline Novice
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    17
    We ended up using an IF statement in the query on an alias field. and then summing the alias field on the report. Thanks for your reply

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

Similar Threads

  1. invoice if there are past due amount
    By azhar2006 in forum Queries
    Replies: 10
    Last Post: 02-23-2014, 05:27 PM
  2. total amount
    By sdc1234 in forum Queries
    Replies: 12
    Last Post: 02-19-2014, 03:37 PM
  3. splitting an amount
    By mohiahmed in forum Access
    Replies: 1
    Last Post: 07-15-2013, 04:39 PM
  4. Calculation of amount boxes
    By visidro in forum Access
    Replies: 4
    Last Post: 03-16-2013, 02:05 PM
  5. limiting amount of records
    By yaro.kobzar in forum Programming
    Replies: 1
    Last Post: 05-17-2011, 07:01 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