Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Jun 2002
    Location
    Placerville, California, USA
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing a CheckBox in Report (2003)

    I have a report where I only want to print the checkbox if it has been checked....ideas?

  2. #2
    Lounger
    Join Date
    Nov 2006
    Location
    Denver, Colorado, USA
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a CheckBox in Report (2003)

    Put the following code into the Detail section of the report. Replace the name of the check control with the one from your report. Also, the Visible property doesn't show up in intellesense for reports but it still works the same as it does in forms.

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

    If Me.CheckIsChecked.Value = True Then
    Me.CheckIsChecked.Visible = True
    Else
    Me.CheckIsChecked.Visible = False
    End If

    End Sub

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Printing a CheckBox in Report (2003)

    You could simplify this:
    If Me.CheckIsChecked.Value = True Then
    Me.CheckIsChecked.Visible = True
    Else
    Me.CheckIsChecked.Visible = False
    End If

    to:

    Me.CheckIsChecked.Visible = Me.CheckIsChecked

  4. #4
    Lounger
    Join Date
    Jun 2002
    Location
    Placerville, California, USA
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a CheckBox in Report (2003)

    Thanks for the quick reply!

    I tired your suggestion, but since where I want to accomplish this is in a group footer it does not work. I get the following error:

    Compile Error: method or data member not found.

    Then when I go to the de###### I get the following error:

    Private Sub GroupFooter4_Format(Cancel As Integer, FormatCount As Integer)

    Any ideas? Or does this only work in the detail section and not a group footer?

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

    Re: Printing a CheckBox in Report (2003)

    It should work in a group footer as well as in the detail section.

    Your code should look as follows, assuming that GroupFooter4 is the name of the group footer containing the check box. You should replace NameOfCheckBox with the actual name of your check box:

    Private Sub GroupFooter4_Format(Cancel As Integer, FormatCount As Integer)
    Me.[NameOfCheckBox].Visible = Me.[NameOfCheckBox]
    End Sub

  6. #6
    Lounger
    Join Date
    Nov 2006
    Location
    Denver, Colorado, USA
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a CheckBox in Report (2003)

    Does your report still have a GroupFoodter_4? Is there any reference to any object in the code that doesn't have an associated object in the report? i.e.) did you change the name of the check control that I used in the code sample to the name of the check control that's actually in your report?

    Patrick.

Posting Permissions

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