Results 1 to 3 of 3
  1. #1
    astaff4 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    2

    Add a Text Box to a Report Showing the Result of an Unrelated Query

    I am very new to Access, so I will try to be as detailed as possible....

    I am working on a report that shows a running roster of all the incidents my office tracks that occurred this year in 2013. Currently there are two versions of the report. One runs off of the main table where the records are kept and filters on opening to only show 2013 cases. The other copy runs off of an existing query that isolates 2013 cases for a separate database function.

    I am attempting to add a box at the bottom of the report (either copy as long as it works) in the report footer that shows the number of incidents we had by this point in 2012. I thought I could do this by creating an unbound text box and typing a formula into the control source. However I haven't been able to figure out the formula. I did manage to create a query that pulls the records I want to count by using the criteria

    Code:
     <DateAdd("yyyy",-1,Date())) and >#2012/01/01#
    .....but I can't figure out how to count those records from an unbound text box on an unrelated report.



    Any help would be greatly appreciated as I am stumped.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Could try domain aggregate function. I don't know the structure of the 2012 query but maybe like:

    =DCount("*", "queryname")
    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
    astaff4 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    2
    Thank you for taking the time to answer.
    That worked! I had tried to use the domain aggregate function before but I had used the expression builder and clicked on the field which ended up writing the function as:
    =DCount("*",[queryname]![fieldname]) instead of =DCount("*","queryname")
    Now I feel silly, thank you again for your help!

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

Similar Threads

  1. show a query result in a text box
    By mikael in forum Access
    Replies: 2
    Last Post: 09-13-2012, 02:17 AM
  2. Replies: 8
    Last Post: 05-16-2012, 09:30 AM
  3. Replies: 1
    Last Post: 09-28-2011, 09:48 PM
  4. Replies: 17
    Last Post: 08-19-2011, 01:19 PM
  5. Replies: 2
    Last Post: 04-29-2009, 11:50 AM

Tags for this Thread

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