Results 1 to 4 of 4
  1. #1
    crimedog is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    141

    Report Filtered to One Rep and Summarized by DSUM


    I have a query I run on my data tables. I filter the query by a ComboBox on a form (Rep Name)- then button on form runs report in print preview.
    I only want to have one required input for filtering. So I have a report set up with January - December as Labels and a text box for each month.
    In the text box I have a DSUM calculation that limits it to current Year the month (Jan-Dec) and sums the cost.

    When the Labels and Text Boxes are in the Details section it looks like it trying to use multiple reps - when I put everything in the header it looks to be one record (which is what I want - a sum of all the costs by month for the selected rep)

    It looks pretty - but I have to be doing something wrong - I am getting #Type errors in my summed fields

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Post the expression used in the DSum.

    Or provide the db for analysis. Follow instructions at bottom of my post.
    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
    crimedog is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    141
    Code:
    =DSum([AnnualResultsMgr].[SalesRevenue],[AnnualResultsMgr],[AnnualResultsMgr].[InvoiceMo]=12 And [AnnualResultsMgr].[InvoiceYr]=(Year(Date())-1))
    [AnnualResultsMgr] is a query
    [SalesRevenue] is a field in the query
    [InvoiceMo] is a field in the query
    [InvoiceYr] is a field in the query

    The query is filtered by manager

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Need static parts of the arguments in quote marks. Not seeing reference to custom variables or form controls.

    =DSum("[SalesRevenue]", "[AnnualResultsMgr]", "[InvoiceMo]=12 And [InvoiceYr]=Year(Date())-1")

    Access Help has more guidance on using domain aggregates.
    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: 1
    Last Post: 06-26-2013, 09:17 AM
  2. Open filtered report
    By 2013user in forum Reports
    Replies: 3
    Last Post: 02-07-2013, 12:53 PM
  3. Replies: 3
    Last Post: 11-06-2012, 03:25 PM
  4. DSum syntax for report
    By dwilson in forum Access
    Replies: 2
    Last Post: 09-08-2011, 07:31 PM
  5. Filtered Report
    By Desstro in forum Reports
    Replies: 3
    Last Post: 06-18-2010, 09:09 AM

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