I have a report with several different subreports. What I need to do is keep the header and column titles but show "No data found for this timeframe" (dates are passed in)
and close up the white space if there are not any records for that subreport. I've tried the suggestions here and while I don't get an error, I don't see the statement nor is the white space closing up. This is what I have.
I have 5 text boxes where 3 hold text and 2 hold numbers.
What I see when I run the report is a zero for both text boxes that have numbers. This is why I added the Ctrl.Value = 0
I plan on adding the code to each subreport
Thanks for any help
lhuffst
and close up the white space if there are not any records for that subreport. I've tried the suggestions here and while I don't get an error, I don't see the statement nor is the white space closing up. This is what I have.
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim Ctrl As Control
Dim Shrink As Double
Dim NewTop As Double
For Each Ctrl In Me.Controls
If Ctrl.ControlType = acTextBox Then
If IsNull(Ctrl.Value) Or Ctrl.Value = "" Or Ctrl.Value = 0 Then
Ctrl.Visible = False
Shrink = Shrink + Ctrl.Height
Else
Ctrl.Visible = True
End If
End If
NewTop = Ctrl.top - Shrink
If NewTop > 0 Then Ctrl.top = NewTop Else Ctrl.top = 0
Next Ctrl
lblNoData.Visible = True
lblNoData.Caption = "There wasn't any new Meters tested during this timeframe"
End Sub
What I see when I run the report is a zero for both text boxes that have numbers. This is why I added the Ctrl.Value = 0
I plan on adding the code to each subreport
Thanks for any help
lhuffst