Results 1 to 5 of 5
  1. #1
    mrmmickle1's Avatar
    mrmmickle1 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Location
    North Carolina
    Posts
    78

    Report Question on Calculated Label or Text Box

    I have a report that is based on one query. I would like to add one additional piece of information to the report though. It is a single number returned from a query that counts all Distinct Order Numbers. This information comes from a different table than the report is based on. Is there an easy way to insert this on my report in a label or textbox?

    I am looking for a way to possible do this with a formula. So I have a few questions.

    1. Is this possible to accomplish in a formula?
    2. Is this query efficient or is there a better way to accomplish this task?
    3. How do I achieve the end result I describe above?

    The query looks like this:

    Code:
    SELECT Count(Q1.ORDERNUM) AS Expr1
    FROM (SELECT DISTINCT ORDERNUM FROM tblPendingSamples)  AS Q1;
    I appreciate the help. Thanks for looking into my issue.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    In a textbox:

    =DLookup("Expr1", "QueryName")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,950
    You could save the SELECT DISTINCT query as an object and do a DCount in the form's RecordSource query or in textbox.

    DCount("*", "Query1")
    Last edited by June7; 07-26-2015 at 12:27 PM.
    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.

  4. #4
    mrmmickle1's Avatar
    mrmmickle1 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Location
    North Carolina
    Posts
    78
    Thanks so much! Both of these methods work perfectly.

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    No problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Hide report label when text box is null/blank
    By crsport3 in forum Access
    Replies: 7
    Last Post: 10-30-2013, 07:14 AM
  2. Replies: 5
    Last Post: 04-24-2013, 08:50 AM
  3. Parameter Query/Report Question to Count Text
    By Lettyg82 in forum Reports
    Replies: 6
    Last Post: 08-13-2012, 03:47 PM
  4. a Question about Free text in a report.
    By fedesc in forum Access
    Replies: 3
    Last Post: 10-26-2011, 11:31 AM
  5. Replies: 8
    Last Post: 08-09-2011, 09:04 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