Results 1 to 5 of 5
  1. #1
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231

    Report date will not display when there is no data.


    I have a report that is printed at several locations in our network. I need this report to print even when there is no data; an empty report prints and is needed for audit purposes. The report asks for start and end dates before printing, but does not show up on the report with no data. How can I get the dates into this report?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Test the rpt qry for a null value, if null, print a No Data report else print YOUR report.

    if isnull(dcount([field],qry)) then
    Docmd.openreport "rptNoData"
    else
    Docmd.openreport "rptMyRpt"
    end if

  3. #3
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231
    If the record count on some field is NULL (what is qry?) then open a report called rptNoData, else open a report called rptMyRpt. Is that the gist? I'm still learning VBA but understand programming, so I could use a little explanation here. The rptNoData is the same report as rptMyRpt. Do I need to copy and rename rptMyRpt in order to differentiate?

    A little report background. I use a wild card to select which location is printing, I have 6 locations. I can do one at a time or all at once, depending. One of these reports may not have any data, but I need the printout regardless. Also, in an unbound box I have this code to get a date =[Week Start?].

  4. #4
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    Hi,

    you can solve this in an easy way by putting the two date criteria as unbound text boxes ([txtFrom] and [txtTill]) on a form ([frmCriteria])and then put a calculated text box in the report header with as a control source something like:
    ="Criteria: from " & [Forms]![frmCriteria]![txtFrom] & " till " & [Forms]![frmCriteria]![txtTill]

  5. #5
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231
    Found an easier way. I put =DateAdd("d",[Days Ahead?],Date()) in the start date and =DateAdd("d",[Days Ahead?],Date())+4 in the end date. Works like a champ.

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

Similar Threads

  1. Display a From Date and To Date on a report
    By Sprinter72 in forum Reports
    Replies: 1
    Last Post: 11-23-2014, 11:16 AM
  2. Replies: 11
    Last Post: 07-20-2014, 06:22 PM
  3. Replies: 7
    Last Post: 12-06-2012, 03:10 PM
  4. Replies: 2
    Last Post: 02-20-2010, 01:11 AM
  5. Report to display multiple records by date.
    By af01waco in forum Reports
    Replies: 1
    Last Post: 03-21-2009, 02:12 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