Hiding subreports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Cant figure out how to make a unbound subreport invisible depending on a
value in a txtbox in the same report.
Subreport name: rptAvanse pr Firma-sub2
Text box name: Status4, placed in the pagefooter.

Subreport should be visible only if the value in Status = 4

Tried this in the pagefooter section and event format:
Me.[rptAvanse pr Firma-sub2].Invisible = (Me.Status4 <> 4), without sucess.
The text box gets its value from another subreport in rptAvanse pr Firma-sub2.
Any suggestion.
 
Hi,
try:

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

If Me.Status4.Value = 4 Then
Me.YourReportControlName.Visible = True
Else
Me.YourReportControlName.Visible = False
End If

End Sub

HTH
Good luck
 
Been on vacation and done some other changes on my database (took some time)
however;
Tried your suggestion on the detail section in my subreport:

If Me.StatusSub1.Value = Null Then
Me.[rptAvanse pr firma-sub1].Report.Visible = True
Else
Me.[rptAvanse pr firma-sub1].Report.Visible = False
End If

Get run time error 2465, Couldnt find the field you are referring too in the
expression.
This is the line thats yellowed out when I choose debug:
"Me.[rptAvanse pr firma-sub1].Report.Visible = False"
I checked the report name, but its correct.

Am I far away here?

--
TomH


freakazeud skrev:
Hi,
try:

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

If Me.Status4.Value = 4 Then
Me.YourReportControlName.Visible = True
Else
Me.YourReportControlName.Visible = False
End If

End Sub

HTH
Good luck

--
Oliver
Admin Specialist & Computer Science Major @ UMD - Go Terps - :)
http://www.oli-s.de


TomH said:
Cant figure out how to make a unbound subreport invisible depending on a
value in a txtbox in the same report.
Subreport name: rptAvanse pr Firma-sub2
Text box name: Status4, placed in the pagefooter.

Subreport should be visible only if the value in Status = 4

Tried this in the pagefooter section and event format:
Me.[rptAvanse pr Firma-sub2].Invisible = (Me.Status4 <> 4), without sucess.
The text box gets its value from another subreport in rptAvanse pr Firma-sub2.
Any suggestion.
 
Hi,
to check for a null value the code would look like this:

If IsNull(Me.StatusSub1) Then
....

HTH
Good luck

--
Oliver
Admin Specialist & Computer Science Major @ UMD - Go Terps - :)
http://www.oli-s.de


TomH said:
Been on vacation and done some other changes on my database (took some time)
however;
Tried your suggestion on the detail section in my subreport:

If Me.StatusSub1.Value = Null Then
Me.[rptAvanse pr firma-sub1].Report.Visible = True
Else
Me.[rptAvanse pr firma-sub1].Report.Visible = False
End If

Get run time error 2465, Couldnt find the field you are referring too in the
expression.
This is the line thats yellowed out when I choose debug:
"Me.[rptAvanse pr firma-sub1].Report.Visible = False"
I checked the report name, but its correct.

Am I far away here?

--
TomH


freakazeud skrev:
Hi,
try:

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

If Me.Status4.Value = 4 Then
Me.YourReportControlName.Visible = True
Else
Me.YourReportControlName.Visible = False
End If

End Sub

HTH
Good luck

--
Oliver
Admin Specialist & Computer Science Major @ UMD - Go Terps - :)
http://www.oli-s.de


TomH said:
Cant figure out how to make a unbound subreport invisible depending on a
value in a txtbox in the same report.
Subreport name: rptAvanse pr Firma-sub2
Text box name: Status4, placed in the pagefooter.

Subreport should be visible only if the value in Status = 4

Tried this in the pagefooter section and event format:
Me.[rptAvanse pr Firma-sub2].Invisible = (Me.Status4 <> 4), without sucess.
The text box gets its value from another subreport in rptAvanse pr Firma-sub2.
Any suggestion.
 
Tried with a value, but still not working.
I think the problem is something else. As I mentioned in the first post
there is another subreport, in fact 2 subreports, in the subreport I want to
hide. Can it be something there?

--
TomH


freakazeud skrev:
Hi,
to check for a null value the code would look like this:

If IsNull(Me.StatusSub1) Then
...

HTH
Good luck

--
Oliver
Admin Specialist & Computer Science Major @ UMD - Go Terps - :)
http://www.oli-s.de


TomH said:
Been on vacation and done some other changes on my database (took some time)
however;
Tried your suggestion on the detail section in my subreport:

If Me.StatusSub1.Value = Null Then
Me.[rptAvanse pr firma-sub1].Report.Visible = True
Else
Me.[rptAvanse pr firma-sub1].Report.Visible = False
End If

Get run time error 2465, Couldnt find the field you are referring too in the
expression.
This is the line thats yellowed out when I choose debug:
"Me.[rptAvanse pr firma-sub1].Report.Visible = False"
I checked the report name, but its correct.

Am I far away here?

--
TomH


freakazeud skrev:
Hi,
try:

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

If Me.Status4.Value = 4 Then
Me.YourReportControlName.Visible = True
Else
Me.YourReportControlName.Visible = False
End If

End Sub

HTH
Good luck

--
Oliver
Admin Specialist & Computer Science Major @ UMD - Go Terps - :)
http://www.oli-s.de


:

Cant figure out how to make a unbound subreport invisible depending on a
value in a txtbox in the same report.
Subreport name: rptAvanse pr Firma-sub2
Text box name: Status4, placed in the pagefooter.

Subreport should be visible only if the value in Status = 4

Tried this in the pagefooter section and event format:
Me.[rptAvanse pr Firma-sub2].Invisible = (Me.Status4 <> 4), without sucess.
The text box gets its value from another subreport in rptAvanse pr Firma-sub2.
Any suggestion.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top