Results 1 to 7 of 7
  1. #1
    ADH
    Guest

    Parameters: Print when no data

    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?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Parameters: Print when no data

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

  3. #3
    ADH
    Guest

    Re: Parameters: Print when no data

    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.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Parameters: Print when no data

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

  5. #5
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    London, Ontario, Canada
    Posts
    437
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Parameters: Print when no data

    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 <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  6. #6
    DaveShmave
    Guest

    Re: Parameters: Print when no data

    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

  7. #7
    ADH
    Guest

    Re: Parameters: Print when no data

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •