• Parameters: Print when no data

    Author
    Topic
    #1768920

    I need to print the parameters I am sending from another form onto the report. eg: Forms![frmName]![txtName] This works fine if there are matching records, but does not work if there are no matching records. I’ve figured out some very cumbersome If and Null conditions, but there must be a better way. Any ideas?

    Viewing 2 reply threads
    Author
    Replies
    • #1781262

      Why would you print the report at all if there were no matching records?

      • #1781318

        I still want to print the parameters chosen along with a message such as “no records”. This 1) assures the user that the correct parameters were input and 2) some reports, regardless of outcome, need to be sent on to other parties. (example: how many classes has this student taken? Answer: none.) Thanks for replying.

        • #1781325

          But if there are no records, you don’t have any way to print the parameters because the query doesn’t return anything.

        • #1781337

          The underlying query should result in returning at least the StudentID. If not, I would assume an obvious data entry error. If it does return a valid StudentID – this field could/should be linked to tblClasses in a One to Many relationship. On the report, the StudentID and other fields relevant to the student will appear and a Count of Classes would return 0 if no related records were found in tbl Classes. Or am I missing something shrug

    • #1781336

      I think the confusion is why would you need a report to print if there was nothing in the recordset to print? Is this some sort of paper form that people use for later in the day when they do data entry?

      Regardless, why not just create a blank version of your report so that no records are required to produce the report?

      Make a copy of the report and name it rptReportBlank (whatever you want to call it). Then remove anything in the blank report that refers to data (query, table, controls on the report, etcetera). Leave your parameters in place that your refrencing from the form. The report should print just fine now; blank except the referenced parameters.

      Does that make any sense?

      HTH

      Dave

    • #1781339

      Thanks for responses. I have a training system that tracks courses taken. The user wants to enter Course From – To dates. ie: 01/01/99 to 06/01/99 and list all students and courses that they have taken. If there are no courses taken in that time period, a report stating so is needed “for the records” or in some cases to send to individual students notifying them that they have not taken courses in the selected time period. (This system tracks certain licenses that expire in 3 years. During the 3 years, they are required to take a certain number of credits- which varies according to license. Every year reports are sent to each licensee informing them of credits earned, or lack thereof.) Does this make more sense?

    Viewing 2 reply threads
    Reply To: Parameters: Print when no data

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: