I'm trying to create a report base on a form that amongst other data, has 4 check boxes and each has a few associated fields. If all of those associated fields are blank, then obviously the checkbox would be blank.
In my report, based on that form, I want to hide the checkbox and its associated fields and labels if that checkbox is blank.
The report is formatted like so... Line 1 - customer data, Line 2 - checkbox 1 and associated data, Line 3 - check box 2 and associated data, Line 4 - checkbox 3 and associated data, and so on till the last check box, then the next record and repeat. I put the following code in the load event of the report:
Private Sub Report_Load()
If Me.PayforYear = False Then
Me.PayforYear.Visible = False
Me.PFYLabel.Visible = False
Me.PFYAMTLabel.Visible = False
Me.PFY_Amount.Visible = False
Me.PFY_Startdate.Visible = False
Me.PFY_Enddate.Visible = False
Me.PFYStartLabel.Visible = False
Me.PFYEndLabel.Visible = False
End If
If Me.Past_Due = False Then
Me.Past_Due.Visible = False
Me.PastDueLabel.Visible = False
Me.PastDueAmtLabel.Visible = False
Me.Past_Due_Amount.Visible = False
Me.Past_Due_paidtill_Date.Visible = False
Me.PayTillLabel.Visible = False
End If
If Me.Standard_Payment = False Then
Me.Standard_Amount.Visible = False
Me.StandardLabel.Visible = False
Me.Standard_Payment.Visible = False
Me.StandardAmtLabel.Visible = False
End If
If Me.Recurring = False Then
Me.Recurring.Visible = False
Me.RecurringLabel.Visible = False
Me.Reoccurring_Amount.Visible = False
Me.RecurringAmtLabel.Visible = False
Me.Reoccurring_Startdate.Visible = False
Me.RecurringStartLabel.Visible = False
End If
This works, but not consistently. Meaning all the records are based on what checkmarks are checked in the first record. Ex. If record 1 has checkmark 1 checked only, it will hide all that are unchecked, but also keep those same ones hidden in the rest of the records regardless if they are checked or not in those records. What is wrong with this and how can I fix it to display only the checked checkboxes for EACH record in the report?
In my report, based on that form, I want to hide the checkbox and its associated fields and labels if that checkbox is blank.
The report is formatted like so... Line 1 - customer data, Line 2 - checkbox 1 and associated data, Line 3 - check box 2 and associated data, Line 4 - checkbox 3 and associated data, and so on till the last check box, then the next record and repeat. I put the following code in the load event of the report:
Private Sub Report_Load()
If Me.PayforYear = False Then
Me.PayforYear.Visible = False
Me.PFYLabel.Visible = False
Me.PFYAMTLabel.Visible = False
Me.PFY_Amount.Visible = False
Me.PFY_Startdate.Visible = False
Me.PFY_Enddate.Visible = False
Me.PFYStartLabel.Visible = False
Me.PFYEndLabel.Visible = False
End If
If Me.Past_Due = False Then
Me.Past_Due.Visible = False
Me.PastDueLabel.Visible = False
Me.PastDueAmtLabel.Visible = False
Me.Past_Due_Amount.Visible = False
Me.Past_Due_paidtill_Date.Visible = False
Me.PayTillLabel.Visible = False
End If
If Me.Standard_Payment = False Then
Me.Standard_Amount.Visible = False
Me.StandardLabel.Visible = False
Me.Standard_Payment.Visible = False
Me.StandardAmtLabel.Visible = False
End If
If Me.Recurring = False Then
Me.Recurring.Visible = False
Me.RecurringLabel.Visible = False
Me.Reoccurring_Amount.Visible = False
Me.RecurringAmtLabel.Visible = False
Me.Reoccurring_Startdate.Visible = False
Me.RecurringStartLabel.Visible = False
End If
This works, but not consistently. Meaning all the records are based on what checkmarks are checked in the first record. Ex. If record 1 has checkmark 1 checked only, it will hide all that are unchecked, but also keep those same ones hidden in the rest of the records regardless if they are checked or not in those records. What is wrong with this and how can I fix it to display only the checked checkboxes for EACH record in the report?