Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Sub Report

Status
Not open for further replies.

BusMgr

IS-IT--Management
Aug 21, 2001
138
0
0
US
I have a subreport with multiple controls on them with names as details1, details 2, details3 etc.

I am trying to get the report to format correctly when I output it.

My code is as follows

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

Dim intCtr as Integer

For IntCtr = 1 to 12
If Me(&quot;FromDepth&quot; & intCtr) <> &quot;&quot; Then
Me(&quot;lblDrillF&quot; & intCtr).Visible = True
Else
Me(&quot;Detail&quot; & intCtr).Visible = True
End If
End Sub

What I want is that if FromDepth1 (to 12) has a value in it, then I want the lblDrillF1 (to 12) to be visible, else if there is no value in FromDepth1 (to 12), I want Detail1 (to 12) to be visible.

It works the first time around, but then I get the message &quot;Invalid use of Null&quot;

Thanks for your help.

Regards
BusMgr
 
Try turning it around and get a good null check

If IsNull(Me(&quot;FromDepth&quot; & intCtr)) Then
Me(&quot;Detail&quot; & intCtr).Visible = True
Else
Me(&quot;lblDrillF&quot; & intCtr).Visible = True
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top