briancross
New member
- Local time
- Today, 18:12
- Joined
- Sep 1, 2009
- Messages
- 7
I am currently building a report, however I am running into a roadblock that is stopping me from reaching my desired result.
Each record in the detail section of my report has a standard tabular section (with column names in the report header). Below that are three more groups of controls that are shown dependent on the data (ie - there are several controls related to a boolean field named TRR_required. If TRR_required is false all these items are hidden). I would like to only display these groups if the required field is true. I have successfully been able to hide the controls by setting Visible = false for the appropriate controls, however this simply leaves a blank area in the detail section for each record. Using me.detail.autoheight = true causes Access to crash when trying to render the report in print preview view.
Here is what I have for code on detail_format:
I have a feeling I'm missing something simple, but any help at all would be greatly appreciated!
Each record in the detail section of my report has a standard tabular section (with column names in the report header). Below that are three more groups of controls that are shown dependent on the data (ie - there are several controls related to a boolean field named TRR_required. If TRR_required is false all these items are hidden). I would like to only display these groups if the required field is true. I have successfully been able to hide the controls by setting Visible = false for the appropriate controls, however this simply leaves a blank area in the detail section for each record. Using me.detail.autoheight = true causes Access to crash when trying to render the report in print preview view.
Here is what I have for code on detail_format:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.PSRR_req.Value = False Then
With Me
.PSRR_req.Visible = False
'related controls also marked visible = false
End With
Else
With Me
.PSRR_req.Visible = True
'related controls also marked visible = true
End With
End If
If Me.TRR_req.Value = False Then
With Me
.TRR_req.Visible = False
'related controls also marked visible = false
End With
Else
With Me
.TRR_req.Visible = True
'related controls also marked visible = true
End With
End If
If Me.Comments.Text = "" Then
With Me
.Comments.Visible = False
.Label27.Visible = False
End With
Else
With Me
.Comments.Visible = True
.Label27.Visible = True
End With
End If
'Me.Detail.AutoHeight = True
End Sub
I have a feeling I'm missing something simple, but any help at all would be greatly appreciated!