Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Carlisle, PA

    Unanswered: No Data event in subreports

    I am using a report with multiple subreports. I need one inparticular, rptgencomment to be hidden when there is no data in the detail section of this subreport. I have used the no data event, tried saying that if the textbox within this subreport (actually the query it is based on) is = " " then do not print, and have used the .hasdata option. Nothing seems to work, it's driving me crazy!!!!

    If anybody can help me out I would appriciate it greatly.

    The name of the main report is report_rptPatient_Header. The subreport is report_rptGenComment.

    Thank you so much!

  2. #2
    Join Date
    May 2003
    Provided Answers: 5
    all you have to do is dcount the recordsource of the subreport

    dim x
    x = dcount("[somefield]",forms!subformname.recordsource)
    if x = 0 then
    forms!subformname.visible = false
    mytextbox.visible = true
    end if

    The on no data event actually does a count of records from the recordsource and if it is zero then the event fires.

    so that is all you have to do.

    run the code behind the open event of the main report.

Posting Permissions

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