Results 1 to 3 of 3

Thread: Reports (2002)

  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reports (2002)

    I have a report that contains properties and a subreport that contains jobs related to those properties. I need to be able to programmatically hide/unhide some fields in the subreport based on check box selections made from a form that calls this report. I also want to be able to hide/undhide several paragraphs of static text associated with the property, again based on check box selections from the calling form. In addition, I'll need to be able reprint the individual property data at the top of the next page if the job subreport goes beyond one page. Based on what I've read so far, I think I need to use grouping levels in order to accomplish the hide/unhide and section properties to reprint the property data , but I'm not comlpetely sure. Ok, now to the question, although I guess it's really a request. Can anyone point me to some sample code and/or give me some advice on how best to accomplish these things? Any help would be greatly appreciated.

    Thanks...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports (2002)

    1. You can hide/unhide controls in the On Format event of the section that contains the controls. Let's say (for illustration purposes) that the calling form is named frmCallingForm (how original!), with check boxes chkBox1, chkBox2 and chkBox3. You have controls txtBox1, txtBox2 and txtBox3 in the Detail section of your report, and their visibility is to be governed by the corresponding check boxes. The On Format event procedure would look like this:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.txtBox1.Visible = Forms!frmCallingForm!chkBox1
    Me.txtBox2.Visible = Forms!frmCallingForm!chkBox2
    Me.txtBox3.Visible = Forms!frmCallingForm!chkBox3
    End Sub

    2. To repeat controls, you must indeed group your main report on property, display property information in the group header, and set Repeat Section for the group header to Yes. The subreport could go into the (otherwise empty) detail section.

    Note: you may be able to create a query that returns both the property information and the job information. You wouldn't need a subreport then. Property information would go into the group header, job information into the detail section.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reports (2002)

    Thanks Hans, that's exactly what I needed to know.

Posting Permissions

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